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
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-03-03 19:47:34 +0300
committerSergey Sharybin <sergey@blender.org>2022-03-03 19:47:34 +0300
commit908ac7dce21e04767550a9b75b197476e85f3774 (patch)
tree67d44180cbaeaf0fb9f5c84e3b1ce7520cf3705d /intern
parentd793d184137afb786a4777ce9e995b569e82f5a8 (diff)
parent769ae5c866f32d7a224c141ed4e3e899a54ec150 (diff)
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/session/session.cpp14
-rw-r--r--intern/cycles/session/session.h4
2 files changed, 12 insertions, 6 deletions
diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp
index 4d9d0388a15..ef177636046 100644
--- a/intern/cycles/session/session.cpp
+++ b/intern/cycles/session/session.cpp
@@ -110,11 +110,7 @@ void Session::start()
void Session::cancel(bool quick)
{
/* Check if session thread is rendering. */
- bool rendering;
- {
- thread_scoped_lock session_thread_lock(session_thread_mutex_);
- rendering = (session_thread_state_ == SESSION_THREAD_RENDER);
- }
+ const bool rendering = is_session_thread_rendering();
if (rendering) {
/* Cancel path trace operations. */
@@ -275,6 +271,12 @@ void Session::thread_render()
progress.set_update();
}
+bool Session::is_session_thread_rendering()
+{
+ thread_scoped_lock session_thread_lock(session_thread_mutex_);
+ return (session_thread_state_ == SESSION_THREAD_RENDER);
+}
+
RenderWork Session::run_update_for_next_iteration()
{
RenderWork render_work;
@@ -557,7 +559,7 @@ void Session::set_pause(bool pause)
}
}
- if (session_thread_) {
+ if (is_session_thread_rendering()) {
if (notify) {
pause_cond_.notify_all();
}
diff --git a/intern/cycles/session/session.h b/intern/cycles/session/session.h
index 26d8f19fdde..3e90b41e3e9 100644
--- a/intern/cycles/session/session.h
+++ b/intern/cycles/session/session.h
@@ -162,6 +162,10 @@ class Session {
void thread_run();
void thread_render();
+ /* Check whether the session thread is in `SESSION_THREAD_RENDER` state.
+ * Returns true if it is so. */
+ bool is_session_thread_rendering();
+
/* Update for the new iteration of the main loop in run implementation (run_cpu and run_gpu).
*
* Will take care of the following things: