aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/conn.h
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2018-11-18 18:19:56 -0500
committerDeterminant <ted.sybil@gmail.com>2018-11-18 18:19:56 -0500
commita6796aa623b2c34d7f680a5ccae74ec893f16d36 (patch)
treec4e113243e2e76549ca9a17b2fe56df1a5e50fbd /include/salticidae/conn.h
parent499fcb776d691da06ec2da9a0fbadc3cbcf8758f (diff)
...
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();
}