correct threading around clearing the viewer sequences

This commit is contained in:
itsmattkc
2019-03-22 03:33:18 +11:00
parent b96d97aa07
commit 22b208143b
6 changed files with 62 additions and 34 deletions
+16
View File
@@ -273,6 +273,22 @@ void RenderThread::cancel() {
wait();
}
void RenderThread::wait_until_paused()
{
// Wait for thread to finish whatever it's doing before proceeding.
//
// FIXME: This is slow. Perhaps there's a better way...
if (wait_lock_.tryLock()) {
wait_lock_.unlock();
return;
} else {
wait_lock_.lock();
wait_lock_.unlock();
}
}
void RenderThread::delete_buffers() {
front_buffer_1.Destroy();
front_buffer_2.Destroy();