File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/slg/engines/rtpathcpu Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ void RTPathCPURenderEngine::StartLockLess() {
5151}
5252
5353void RTPathCPURenderEngine::StopLockLess () {
54+ // We need to resume paused sessions first,
55+ // otherwise it will hang on a thread barrier.
56+ if (pauseMode)
57+ Resume ();
5458 PathCPURenderEngine::StopLockLess ();
5559}
5660
Original file line number Diff line number Diff line change @@ -85,17 +85,13 @@ void RTPathCPURenderThread::RTRenderFunc(std::stop_token stop_token) {
8585 // Synchronize all threads -> This waits for RTPathCPURenderEngine::PauseThreads()
8686 engine->threadsSyncBarrier ->arrive_and_wait ();
8787
88- while (!stop_token. stop_requested () && engine-> threadsPauseMode )
89- std::this_thread::sleep_for (100ms );
88+ // Wait for the main thread -> This waits for RTPathCPURenderEngine::ResumeThreads( )
89+ engine-> threadsSyncBarrier -> arrive_and_wait ( );
9090
91- // If the above loop was broken because of the stop, we don't want to enter the second
92- // arrive_and_wait() because that would wait for the resume signal, which won't come.
91+ // If the engine was stopped, we break here.
9392 if (stop_token.stop_requested ())
9493 break ;
9594
96- // Wait for the main thread -> This waits for RTPathCPURenderEngine::ResumeThreads()
97- engine->threadsSyncBarrier ->arrive_and_wait ();
98-
9995 (static_cast <RTPathCPUSampler *>(sampler.get ()))->Reset (FilmPtr (&engine->GetFilm ()));
10096 }
10197
You can’t perform that action at this time.
0 commit comments