diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-31 19:28:04 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-31 20:50:02 +0300 |
commit | cec7ee05dca77cd62cce9bb52e612b8c429d500f (patch) | |
tree | 4705003142280729ea71acc8aef84b8a078c0a72 | |
parent | c5b4a9deb550ab5a8a0bb36103a9547da21f8982 (diff) | |
download | libmicrohttpd-cec7ee05dca77cd62cce9bb52e612b8c429d500f.tar.gz libmicrohttpd-cec7ee05dca77cd62cce9bb52e612b8c429d500f.zip |
Fixed deadlock introduced by c5b4a9deb550ab5a8a0bb36103a9547da21f8982
-rw-r--r-- | src/microhttpd/daemon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 640964b8..91ad5406 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -7109,11 +7109,15 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
7109 | mhd_assert (NULL != pos->urh); | 7109 | mhd_assert (NULL != pos->urh); |
7110 | if (! pos->thread_joined) | 7110 | if (! pos->thread_joined) |
7111 | { | 7111 | { |
7112 | /* No need to unlock "cleanup" mutex as upgraded connection | 7112 | /* While "cleanup" list is not manipulated by "upgraded" |
7113 | * doesn't manipulate "cleanup" list. */ | 7113 | * connection, "cleanup" mutex is required for call of |
7114 | * MHD_resume_connection() during finishing of "upgraded" | ||
7115 | * thread. */ | ||
7116 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | ||
7114 | if (! MHD_join_thread_ (pos->pid.handle)) | 7117 | if (! MHD_join_thread_ (pos->pid.handle)) |
7115 | MHD_PANIC (_ ("Failed to join a thread.\n")); | 7118 | MHD_PANIC (_ ("Failed to join a thread.\n")); |
7116 | pos->thread_joined = true; | 7119 | pos->thread_joined = true; |
7120 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | ||
7117 | } | 7121 | } |
7118 | } | 7122 | } |
7119 | } | 7123 | } |