diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-11-01 01:51:12 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-11-01 01:51:12 +0100 |
commit | a018cbaee1130c34a84557a1a9fdf5186ee99fd1 (patch) | |
tree | beef19a0553a52e57a2949beafaae34ab8af3af8 /modules/mono/mono_gd/gd_mono_utils.h | |
parent | 06ea441564937d97b0931aecba771b60e077b1d5 (diff) | |
download | redot-engine-a018cbaee1130c34a84557a1a9fdf5186ee99fd1.tar.gz |
Fix thread checking to queue instances for deletion
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_utils.h')
-rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index e3af57e78a..ebb5d28e4d 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -149,6 +149,10 @@ void attach_current_thread(); void detach_current_thread(); MonoThread *get_current_thread(); +_FORCE_INLINE_ bool is_main_thread() { + return mono_domain_get() != NULL && mono_thread_get_main() == mono_thread_current(); +} + GDMonoClass *get_object_class(MonoObject *p_object); GDMonoClass *type_get_proxy_class(const StringName &p_type); GDMonoClass *get_class_native_base(GDMonoClass *p_class); |