diff options
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.h')
-rw-r--r-- | modules/gdnative/nativescript/nativescript.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 609ffa2bd4..04670b952b 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -35,6 +35,7 @@ #include "core/io/resource_saver.h" #include "core/oa_hash_map.h" #include "core/ordered_hash_map.h" +#include "core/os/mutex.h" #include "core/os/thread_safe.h" #include "core/resource.h" #include "core/script_language.h" @@ -44,10 +45,6 @@ #include "modules/gdnative/gdnative.h" #include <nativescript/godot_nativescript.h> -#ifndef NO_THREADS -#include "core/os/mutex.h" -#endif - struct NativeScriptDesc { struct Method { @@ -127,9 +124,7 @@ class NativeScript : public Script { String script_class_name; String script_class_icon_path; -#ifndef NO_THREADS - Mutex *owners_lock; -#endif + Mutex owners_lock; Set<Object *> instance_owners; protected: @@ -266,9 +261,8 @@ private: void _unload_stuff(bool p_reload = false); + Mutex mutex; #ifndef NO_THREADS - Mutex *mutex; - Set<Ref<GDNativeLibrary> > libs_to_init; Set<NativeScript *> scripts_to_register; volatile bool has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed |