diff options
| author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-06-08 11:33:35 +0200 |
|---|---|---|
| committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-06-09 18:24:01 +0200 |
| commit | 2b001db76e608b5f99a1a4cbed906c233f2cf348 (patch) | |
| tree | 02ffbc308a75c93b27631bba28a43059610c636e /core/object | |
| parent | 828ec2c5d005b6499c7c4c88beaf81767d05614b (diff) | |
| download | redot-engine-2b001db76e608b5f99a1a4cbed906c233f2cf348.tar.gz | |
Let user scripts disable thread safety checks
Diffstat (limited to 'core/object')
| -rw-r--r-- | core/object/worker_thread_pool.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp index afe6ecd1b3..d285be3e70 100644 --- a/core/object/worker_thread_pool.cpp +++ b/core/object/worker_thread_pool.cpp @@ -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); } } |
