fix(library/mt_task_queue): make sure thread finalizers are executed even if lean was compiled without pthread support
This commit is contained in:
parent
e070444bbf
commit
73e5367fb6
1 changed files with 5 additions and 1 deletions
|
|
@ -76,7 +76,11 @@ void mt_task_queue::spawn_worker() {
|
|||
unique_lock<mutex> lock(m_mutex);
|
||||
scoped_add<int> dec_required(m_required_workers, -1);
|
||||
while (true) {
|
||||
if (m_shutting_down) return;
|
||||
if (m_shutting_down) {
|
||||
run_thread_finalizers();
|
||||
run_post_thread_finalizers();
|
||||
return;
|
||||
}
|
||||
if (m_required_workers < 0) {
|
||||
scoped_add<int> inc_required(m_required_workers, +1);
|
||||
scoped_add<unsigned> inc_sleeping(m_sleeping_workers, +1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue