mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Added more comments about data races.
This commit is contained in:
@@ -1824,6 +1824,14 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
|
||||
if (MHD_NO != daemon->resuming)
|
||||
next = daemon->suspended_connections_head;
|
||||
|
||||
/* Clear the flag *only* if connections will be resumed otherwise
|
||||
it may accidentally clear flag that was set at the same time in
|
||||
other thread (just after 'if (MHD_NO != daemon->resuming)' in
|
||||
this thread).
|
||||
Clear flag *before* resuming connections otherwise new connection can
|
||||
be set to "resuming" in other thread, but missed resuming in this
|
||||
function at this time so clearing flag at end will clear it without
|
||||
actually resuming of new connection. */
|
||||
if (NULL != next)
|
||||
daemon->resuming = MHD_NO;
|
||||
while (NULL != (pos = next))
|
||||
|
||||
Reference in New Issue
Block a user