commit 513f49394e9ec361692265d40501c287e719a9ee
parent a90099030e9aa0ec216e6b5cf439c265d8a43376
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Fri, 14 Oct 2016 17:47:21 +0300
MHD_cleanup_connections(): reduce time of lock
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2505,6 +2505,10 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
DLL_remove (daemon->cleanup_head,
daemon->cleanup_tail,
pos);
+
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
+
if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
(MHD_NO == pos->thread_joined) )
{
@@ -2570,6 +2574,9 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
if (NULL != pos->addr)
free (pos->addr);
free (pos);
+
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
}
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);