summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ThreadPool.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ThreadPool.cpp b/src/ThreadPool.cpp
index a1d931a3..d5da4d50 100644
--- a/src/ThreadPool.cpp
+++ b/src/ThreadPool.cpp
@@ -51,6 +51,10 @@ ThreadPool::shut_down()
{
{
std::unique_lock<std::mutex> lock(m_mutex);
+ if (m_shutting_down) {
+ // Already called shut_down.
+ return;
+ }
m_shutting_down = true;
}
m_task_enqueued_or_shutting_down_condition.notify_all();