diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-11-20 10:48:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 10:48:46 +0100 |
commit | be16eb625b8260e6e4f53af3b066602bccab6900 (patch) | |
tree | 936bc0fb4b8a111804476e5383a8b7c4297067c2 /core | |
parent | a74e2c50583d839a8066f5ee2f806a11137a7026 (diff) | |
parent | c558263d84e974c95efe4d1e34539d4232e5d26f (diff) |
Merge pull request #54932 from briansemrau/expose-main-thread-id
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 5 | ||||
-rw-r--r-- | core/core_bind.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index d42d39a159..0bf6efc96d 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -315,6 +315,10 @@ Error OS::set_thread_name(const String &p_name) { return ::Thread::get_caller_id(); }; +::Thread::ID OS::get_main_thread_id() const { + return ::Thread::get_main_id(); +}; + bool OS::has_feature(const String &p_feature) const { return ::OS::get_singleton()->has_feature(p_feature); } @@ -601,6 +605,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("set_thread_name", "name"), &OS::set_thread_name); ClassDB::bind_method(D_METHOD("get_thread_caller_id"), &OS::get_thread_caller_id); + ClassDB::bind_method(D_METHOD("get_main_thread_id"), &OS::get_main_thread_id); ClassDB::bind_method(D_METHOD("has_feature", "tag_name"), &OS::has_feature); diff --git a/core/core_bind.h b/core/core_bind.h index 641e3a33ae..4bacfa720c 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -237,6 +237,7 @@ public: Error set_thread_name(const String &p_name); Thread::ID get_thread_caller_id() const; + Thread::ID get_main_thread_id() const; bool has_feature(const String &p_feature) const; |