Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Common/Cpp/Concurrency/Backends/ThreadPool_Default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ AsyncTask ThreadPool_Default::dispatch(std::function<void()>&& func){
task = AsyncTask(std::make_unique<AsyncTask_Cpp>(std::move(func)));
ptr = task.core();
ptr->report_started();

// Spawn threads to pick up the work. Without this, a pool that
// has not reached its maximum thread count (or has no threads
// at all, as the global pools start out) would never grow, and
// with no threads the notify_one() below would wake nothing and
// the task would never run.
spawn_threads();
}catch (...){
m_queue.pop_back();
throw;
Expand Down
Loading