Added some remarks about functions' thread safety.

This commit is contained in:
Evgeny Grin (Karlson2k)
2016-10-24 15:51:28 +03:00
parent 0701ed2e8a
commit 3e15e43b1f
5 changed files with 18 additions and 3 deletions
+6
View File
@@ -492,6 +492,8 @@ need_100_continue (struct MHD_Connection *connection)
/**
* Close the given connection and give the
* specified termination code to the user.
* @remark To be called only from thread that
* process connection's recv(), send() and response.
*
* @param connection connection to close
* @param termination_code termination reason to give
@@ -2563,6 +2565,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
/**
* Clean up the state of the given connection and move it into the
* clean up queue for final disposal.
* @remark To be called only from thread that process connection's
* recv(), send() and response.
*
* @param connection handle for the connection to clean up
*/
@@ -2613,6 +2617,8 @@ cleanup_connection (struct MHD_Connection *connection)
/**
* This function was created to handle per-connection processing that
* has to happen even if the socket cannot be read or written to.
* @remark To be called only from thread that process connection's
* recv(), send() and response.
*
* @param connection connection to handle
* @return #MHD_YES if we should continue to process the
+4
View File
@@ -72,6 +72,8 @@ MHD_connection_handle_write (struct MHD_Connection *connection);
* has to happen even if the socket cannot be read or written to. All
* implementations (multithreaded, external select, internal select)
* call this function.
* @remark To be called only from thread that process connection's
* recv(), send() and response.
*
* @param connection connection to handle
* @return MHD_YES if we should continue to process the
@@ -84,6 +86,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection);
/**
* Close the given connection and give the
* specified termination code to the user.
* @remark To be called only from thread that
* process connection's recv(), send() and response.
*
* @param connection connection to close
* @param termination_code termination reason to give
+2
View File
@@ -3683,6 +3683,8 @@ MHD_run (struct MHD_Daemon *daemon)
/**
* Close the given connection, remove it from all of its
* DLLs and move it into the cleanup queue.
* @remark To be called only from thread that
* process daemon's select()/poll()/etc.
*
* @param pos connection to move to cleanup
*/
+3
View File
@@ -698,6 +698,9 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
* We are done sending the header of a given response to the client.
* Now it is time to perform the upgrade and hand over the connection
* to the application.
* @remark To be called only from thread that process connection's
* recv(), send() and response. Must be called right after sending
* response headers.
*
* @param response the response that was created for an upgrade
* @param connection the specific connection we are upgrading
+3 -3
View File
@@ -40,15 +40,15 @@ MHD_increment_response_rc (struct MHD_Response *response);
* We are done sending the header of a given response
* to the client. Now it is time to perform the upgrade
* and hand over the connection to the application.
* @remark To be called only from thread that process connection's
* recv(), send() and response. Must be called right after sending
* response headers.
*
* @param response the response that was created for an upgrade
* @param connection the specific connection we are upgrading
* @return #MHD_YES on success, #MHD_NO on failure (will cause
* connection to be closed)
*/
// FIXME: This function will need to be called at the right place(s)
// in the connection processing (just after we are done sending the header)
// (for responses that have the 'upgrade_header' callback set).
int
MHD_response_execute_upgrade_ (struct MHD_Response *response,
struct MHD_Connection *connection);