aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/conn.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/salticidae/conn.h')
-rw-r--r--include/salticidae/conn.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h
index 79b1a89..2dab517 100644
--- a/include/salticidae/conn.h
+++ b/include/salticidae/conn.h
@@ -345,11 +345,14 @@ class ConnPool {
if (!worker_running) return;
worker_running = false;
SALTICIDAE_LOG_INFO("stopping all threads...");
+ /* stop the dispatcher */
+ workers[0].stop();
+ workers[0].get_handle().join();
/* stop all workers */
- for (size_t i = 0; i < nworker; i++)
+ for (size_t i = 1; i < nworker; i++)
workers[i].stop();
/* join all worker threads */
- for (size_t i = 0; i < nworker; i++)
+ for (size_t i = 1; i < nworker; i++)
workers[i].get_handle().join();
}