Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-04-10 22:18:54 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-04-10 22:18:54 +0300
commit3a80d5e1d0e4952caa76f1d655429375c0da1884 (patch)
treef8cb7754064e37d1cf38b48b40a308794ee7c257 /intern/cycles/util/util_task.cpp
parent50f9681e151361fe6685582cb887818fa2092131 (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.cpp2
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) {