1
0
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:
Pedro J. Estébanez
2023-06-08 11:33:35 +02:00
parent 828ec2c5d0
commit 2b001db76e
6 changed files with 27 additions and 2 deletions

View File

@@ -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);
}
}