We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd3bc75 commit 111dc6dCopy full SHA for 111dc6d
1 file changed
lib/misc/threadpool/threadpool.c
@@ -826,6 +826,7 @@ lws_threadpool_destroy(struct lws_threadpool *tp)
826
#if defined(WIN32)
827
Sleep(1000);
828
#endif
829
+ pthread_mutex_lock(&tp->lock); /* ======================== tpool lock */
830
831
task = tp->task_done_head;
832
while (task) {
@@ -835,6 +836,8 @@ lws_threadpool_destroy(struct lws_threadpool *tp)
835
836
task = next;
837
}
838
839
+ pthread_mutex_unlock(&tp->lock); /* -------------------- tpool unlock */
840
+
841
pthread_mutex_destroy(&tp->lock);
842
843
memset(tp, 0xdd, sizeof(*tp));
0 commit comments