From 1afca1469af2a58e1d3c170b72a8def548495601 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Wed, 7 Aug 2024 10:43:49 +1000 Subject: [PATCH] Don't make idle tasks when shutting down --- src/threading/scheduler/Pool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threading/scheduler/Pool.cpp b/src/threading/scheduler/Pool.cpp index ee19c71d..01ccf1b1 100644 --- a/src/threading/scheduler/Pool.cpp +++ b/src/threading/scheduler/Pool.cpp @@ -151,7 +151,7 @@ namespace threading { Pool::Task Pool::get_idle_task() { // If this pool does not count for idle, it can't participate in idle tasks - if (!descriptor.counts_for_idle) { + if (!running.load(std::memory_order_relaxed) || !descriptor.counts_for_idle) { return Task{nullptr, nullptr}; }