diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-11-12 22:19:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-11-12 22:30:14 +0300 |
commit | b6988de22a9c1b78fe4f5ddedfd4467db1d8e209 (patch) | |
tree | 1afe1f40db2decd3c2c60b3852ff1776369fb46c /intern/cycles/render/session.cpp | |
parent | a6c1c0427c947673b5e05d584bd82285a630336c (diff) | |
parent | d59fa12f2ad5c57c68d63e476270fcd274b61062 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'intern/cycles/render/session.cpp')
-rw-r--r-- | intern/cycles/render/session.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index a60542259f6..524a0e3b9d4 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -98,21 +98,7 @@ Session::Session(const SessionParams ¶ms_) Session::~Session() { - if (session_thread) { - /* wait for session thread to end */ - progress.set_cancel("Exiting"); - - gpu_need_display_buffer_update = false; - gpu_need_display_buffer_update_cond.notify_all(); - - { - thread_scoped_lock pause_lock(pause_mutex); - pause = false; - } - pause_cond.notify_all(); - - wait(); - } + cancel(); if (buffers && params.write_render_cb) { /* Copy to display buffer and write out image if requested */ @@ -146,6 +132,25 @@ void Session::start() } } +void Session::cancel() +{ + if (session_thread) { + /* wait for session thread to end */ + progress.set_cancel("Exiting"); + + gpu_need_display_buffer_update = false; + gpu_need_display_buffer_update_cond.notify_all(); + + { + thread_scoped_lock pause_lock(pause_mutex); + pause = false; + } + pause_cond.notify_all(); + + wait(); + } +} + bool Session::ready_to_reset() { double dt = time_dt() - reset_time; |