Let user scripts disable thread safety checks
This commit is contained in:
parent
828ec2c5d0
commit
2b001db76e
6 changed files with 27 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue