diff options
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; |