src/server/util/thrpool.c

changeset 576
5c31cc844c68
parent 570
f95868a8ec37
child 577
4f5ccaea4a92
--- a/src/server/util/thrpool.c	Fri Jan 31 21:01:48 2025 +0100
+++ b/src/server/util/thrpool.c	Fri Jan 31 21:27:54 2025 +0100
@@ -254,6 +254,12 @@
     while(t < end || i < 2) {
         uint32_t num_threads = pool->num_threads;
         if(num_threads == 0) {
+            // it's possible that we send too many kill jobs, cleanup the queue
+            while(pool->queue) {
+                pool_queue_t *q = pool->queue->next;
+                free(pool->queue);
+                pool->queue = q;
+            }
             break;
         }
         

mercurial