diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-01-26 15:54:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-26 15:54:25 +0100 |
| commit | d6765c8d8b0a2134b051b655d4422b7816731208 (patch) | |
| tree | 335e2f0079949d2aa4683e7649461516be6374b8 /core | |
| parent | 34eb5638d3e8ca9f4f15a3af0e7ab4a7423b69cb (diff) | |
| parent | 35b046ddf7eab341256cced9d1c77e168c52e256 (diff) | |
| download | redot-engine-d6765c8d8b0a2134b051b655d4422b7816731208.tar.gz | |
Merge pull request #44732 from Calinou/os-add-get-thread-caller-id
Add an `OS.get_thread_caller_id()` method
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 000b628ba7..99c68eb433 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -298,6 +298,10 @@ Error _OS::set_thread_name(const String &p_name) { return Thread::set_name(p_name); } +Thread::ID _OS::get_thread_caller_id() const { + return Thread::get_caller_id(); +}; + bool _OS::has_feature(const String &p_feature) const { return OS::get_singleton()->has_feature(p_feature); } @@ -764,6 +768,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_file_access_save_and_swap", "enabled"), &_OS::set_use_file_access_save_and_swap); 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("has_feature", "tag_name"), &_OS::has_feature); diff --git a/core/core_bind.h b/core/core_bind.h index 665858cd26..0fe5d9c80c 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -232,6 +232,7 @@ public: String get_user_data_dir() const; Error set_thread_name(const String &p_name); + Thread::ID get_thread_caller_id() const; bool has_feature(const String &p_feature) const; |
