diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-10 22:18:54 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-10 22:18:54 +0300 |
commit | 3a80d5e1d0e4952caa76f1d655429375c0da1884 (patch) | |
tree | f8cb7754064e37d1cf38b48b40a308794ee7c257 /intern/cycles/util/util_task.cpp | |
parent | 50f9681e151361fe6685582cb887818fa2092131 (diff) |
Cycles: Fix rare dead-locks on TaskScheduler::exit()
When the Moon is full it was possible to have a dead-lock in task
scheduler's exit() method.
Similar problem was fixed in Blender's task scheduler 3 years ago
in bae2a2c.
Diffstat (limited to 'intern/cycles/util/util_task.cpp')
-rw-r--r-- | intern/cycles/util/util_task.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/cycles/util/util_task.cpp b/intern/cycles/util/util_task.cpp index d3aef6c7496..d86aa8a4a46 100644 --- a/intern/cycles/util/util_task.cpp +++ b/intern/cycles/util/util_task.cpp @@ -217,8 +217,10 @@ void TaskScheduler::exit() if(users == 0) { /* stop all waiting threads */ + TaskScheduler::queue_mutex.lock(); do_exit = true; TaskScheduler::queue_cond.notify_all(); + TaskScheduler::queue_mutex.unlock(); /* delete threads */ foreach(thread *t, threads) { |