mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Added missing mutex lock around do_exit assignment in task scheduler
Without this lock it's possible that thread_wait_pop will stuck at the point where it await for new task in the queue but in fact exit was requested already. This ended up in deadlock in some circumstances. Really random because it totally depends on timings.
This commit is contained in:
parent
a03437cb1a
commit
bae2a2c3b2
1 changed files with 2 additions and 0 deletions
|
|
@ -186,8 +186,10 @@ void BLI_task_scheduler_free(TaskScheduler *scheduler)
|
|||
Task *task;
|
||||
|
||||
/* stop all waiting threads */
|
||||
BLI_mutex_lock(&scheduler->queue_mutex);
|
||||
scheduler->do_exit = true;
|
||||
BLI_condition_notify_all(&scheduler->queue_cond);
|
||||
BLI_mutex_unlock(&scheduler->queue_mutex);
|
||||
|
||||
/* delete threads */
|
||||
if(scheduler->threads) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue