You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
WorkerThreadPool: Fix thread message queue not restored after overridden in a task
Also, simplifies the thread override teardown in MessageQueue.
This commit is contained in:
@@ -481,10 +481,7 @@ CallQueue::~CallQueue() {
|
||||
if (!allocator_is_custom) {
|
||||
memdelete(allocator);
|
||||
}
|
||||
// This is done here to avoid a circular dependency between the safety checks and the thread singleton pointer.
|
||||
if (this == MessageQueue::thread_singleton) {
|
||||
MessageQueue::thread_singleton = nullptr;
|
||||
}
|
||||
DEV_ASSERT(!is_current_thread_override);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
@@ -493,7 +490,6 @@ CallQueue *MessageQueue::main_singleton = nullptr;
|
||||
thread_local CallQueue *MessageQueue::thread_singleton = nullptr;
|
||||
|
||||
void MessageQueue::set_thread_singleton_override(CallQueue *p_thread_singleton) {
|
||||
DEV_ASSERT(p_thread_singleton); // To unset the thread singleton, don't call this with nullptr, but just memfree() it.
|
||||
#ifdef DEV_ENABLED
|
||||
if (thread_singleton) {
|
||||
thread_singleton->is_current_thread_override = false;
|
||||
|
||||
Reference in New Issue
Block a user