diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-27 22:43:48 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-10-27 22:45:08 +0300 |
commit | dd327c1d13252373cd1730e445d19930417571bf (patch) | |
tree | 7315a2fb8a569f6a6b1bb591995e27e201b2c617 | |
parent | fd0ceb70580e4fc7096720e123a25970b69631d9 (diff) | |
download | libmicrohttpd-dd327c1d13252373cd1730e445d19930417571bf.tar.gz libmicrohttpd-dd327c1d13252373cd1730e445d19930417571bf.zip |
Skip locking when not required
-rw-r--r-- | src/microhttpd/daemon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 210b929f..da764ca3 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2472,10 +2472,10 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
2472 | int ret; | 2472 | int ret; |
2473 | 2473 | ||
2474 | ret = MHD_NO; | 2474 | ret = MHD_NO; |
2475 | if (MHD_NO == daemon->resuming) | ||
2476 | return ret; | ||
2475 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | 2477 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) |
2476 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 2478 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
2477 | if (MHD_NO != daemon->resuming) | ||
2478 | next = daemon->suspended_connections_head; | ||
2479 | 2479 | ||
2480 | /* Clear the flag *only* if connections will be resumed otherwise | 2480 | /* Clear the flag *only* if connections will be resumed otherwise |
2481 | it may accidentally clear flag that was set at the same time in | 2481 | it may accidentally clear flag that was set at the same time in |