Fix #34205: Cycles: Zooming in rendered mode during update out of sync with intended zoom

Made sure no pause_cond.wait() happens at the same time as session as resetting.
This commit is contained in:
Sergey Sharybin 2013-02-12 13:06:52 +00:00
parent 7c3ce049ed
commit b3b9931276

@ -132,6 +132,8 @@ bool Session::ready_to_reset()
void Session::reset_gpu(BufferParams& buffer_params, int samples)
{
thread_scoped_lock pause_lock(pause_mutex);
/* block for buffer acces and reset immediately. we can't do this
* in the thread, because we need to allocate an OpenGL buffer, and
* that only works in the main thread */
@ -295,6 +297,7 @@ void Session::run_gpu()
void Session::reset_cpu(BufferParams& buffer_params, int samples)
{
thread_scoped_lock reset_lock(delayed_reset.mutex);
thread_scoped_lock pause_lock(pause_mutex);
display_outdated = true;
reset_time = time_dt();
@ -484,7 +487,16 @@ void Session::run_cpu()
* wait for pause condition notify to wake up again */
thread_scoped_lock pause_lock(pause_mutex);
if(pause || no_tiles) {
if(!pause && delayed_reset.do_reset) {
/* reset once to start */
thread_scoped_lock reset_lock(delayed_reset.mutex);
thread_scoped_lock buffers_lock(buffers_mutex);
thread_scoped_lock display_lock(display_mutex);
reset_(delayed_reset.params, delayed_reset.samples);
delayed_reset.do_reset = false;
}
else if(pause || no_tiles) {
update_status_time(pause, no_tiles);
while(1) {