mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
task: start up more worker threads when unpausing
When paused, TaskConsumer threads will eventually notice the paused condition and exit; however, there's nothing to restart threads when exiting the paused state. When unpausing, and while the lock is already held, create TaskConsumer threads as needed to reach the target thread count. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
d74862f1fc
commit
1cbc894e6f
@ -645,6 +645,9 @@ namespace crucible {
|
||||
unique_lock<mutex> lock(m_mutex);
|
||||
m_paused = paused;
|
||||
m_condvar.notify_all();
|
||||
if (!m_paused) {
|
||||
start_threads_nolock();
|
||||
}
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user