renderer: run tickets in the thread they're rendering in

Fixes #1380
This commit is contained in:
itsmattkc
2020-11-27 09:30:09 +11:00
parent f8a5e28c37
commit 1deb95b804
+7
View File
@@ -76,6 +76,9 @@ void ThreadPool::RunNext()
ThreadPoolThread* thread = available_threads_.front();
available_threads_.pop_front();
// Move ticket to other thread so event processing can occur there
ticket->moveToThread(thread);
// Run the ticket in the thread, which actually just calls our virtual function RunTicket
thread->RunTicket(ticket);
}
@@ -119,6 +122,10 @@ void ThreadPoolThread::run()
if (ticket_) {
pool_->RunTicket(ticket_);
// Move back to calling thread (hacky?)
ticket_->moveToThread(this->thread());
ticket_ = nullptr;
}