diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-12 12:14:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-12 12:14:42 +0100 |
commit | bc807766182ee52902464faa4cbf34756b0c868b (patch) | |
tree | 0d9d7ef5750c2d2ef2a52cec0896491a46721e4b /modules/gdscript/gdscript.h | |
parent | 10e820a783e4e8d379e8f55a54c1dc0bc3c5a203 (diff) | |
parent | 271511726b02848783904429c8dde857f6266429 (diff) | |
download | redot-engine-bc807766182ee52902464faa4cbf34756b0c868b.tar.gz |
Merge pull request #84659 from RandomShaper/fix_lambda_cross_thread
Fix lambda cross-thread dynamics
Diffstat (limited to 'modules/gdscript/gdscript.h')
-rw-r--r-- | modules/gdscript/gdscript.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 9717dd7ff1..9b99f5ca0b 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -128,11 +128,16 @@ class GDScript : public Script { Mutex *mutex = nullptr; }; static thread_local UpdatableFuncPtr func_ptrs_to_update_thread_local; + static thread_local LocalVector<List<UpdatableFuncPtr *>::Element> func_ptrs_to_update_entries_thread_local; + static UpdatableFuncPtr *func_ptrs_to_update_main_thread; List<UpdatableFuncPtr *> func_ptrs_to_update; + List<UpdatableFuncPtrElement> func_ptrs_to_update_elems; Mutex func_ptrs_to_update_mutex; - UpdatableFuncPtrElement _add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr); - static void _remove_func_ptr_to_update(const UpdatableFuncPtrElement p_func_ptr_element); + UpdatableFuncPtrElement *_add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr); + static void _remove_func_ptr_to_update(const UpdatableFuncPtrElement *p_func_ptr_element); + + static void _fixup_thread_function_bookkeeping(); #ifdef TOOLS_ENABLED // For static data storage during hot-reloading. @@ -554,6 +559,10 @@ public: virtual void add_named_global_constant(const StringName &p_name, const Variant &p_value) override; virtual void remove_named_global_constant(const StringName &p_name) override; + /* MULTITHREAD FUNCTIONS */ + + virtual void thread_exit() override; + /* DEBUGGER FUNCTIONS */ virtual String debug_get_error() const override; |