You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Let user scripts disable thread safety checks
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "worker_thread_pool.h"
|
||||
|
||||
#include "core/os/os.h"
|
||||
#include "core/os/thread_safe.h"
|
||||
|
||||
void WorkerThreadPool::Task::free_template_userdata() {
|
||||
ERR_FAIL_COND(!template_userdata);
|
||||
@@ -178,6 +179,9 @@ void WorkerThreadPool::_process_task(Task *p_task) {
|
||||
if (post) {
|
||||
task_available_semaphore.post();
|
||||
}
|
||||
|
||||
// Engine/user tasks can set-and-forget, so we must be sure it's back to normal by the end of the task.
|
||||
set_current_thread_safe_for_nodes(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user