[Bf-blender-cvs] [24458a1e7a0] cycles-x: Fix dead-lock when cancelling viewport render in Cycles X

Sergey Sharybin noreply at git.blender.org
Thu Aug 5 17:42:34 CEST 2021


Commit: 24458a1e7a044d1a1c23658fa05aa91c61abefc3
Author: Sergey Sharybin
Date:   Thu Aug 5 17:34:16 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB24458a1e7a044d1a1c23658fa05aa91c61abefc3

Fix dead-lock when cancelling viewport render in Cycles X

This change is supposed to fix a hard-to-reproduce bug when Blender
gets stuck when quitting while viewport render ins going.

Ensure consistency in the check for the pause, so that it is checked
before asking to wait the condition variable. Otherwise it was possible
to miss the notification and not react to the pause state properly.

===================================================================

M	intern/cycles/render/session.cpp

===================================================================

diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 30e4a8953e8..75ca2bc79e9 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -317,7 +317,7 @@ bool Session::run_wait_for_work(const RenderWork &render_work)
 
   update_status_time(pause, no_work);
 
-  while (true) {
+  while (pause) {
     scoped_timer pause_timer;
     pause_cond.wait(pause_lock);
     if (pause) {
@@ -326,10 +326,6 @@ bool Session::run_wait_for_work(const RenderWork &render_work)
 
     update_status_time(pause, no_work);
     progress.set_update();
-
-    if (!pause) {
-      break;
-    }
   }
 
   return no_work;



More information about the Bf-blender-cvs mailing list