Skip to content

Commit

Permalink
Allow GDScript to get current thread ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaos66 committed Dec 26, 2020
1 parent 9649621 commit 1feed85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ Error _OS::set_thread_name(const String &p_name) {
return Thread::set_name(p_name);
}

Thread::ID _OS::get_caller_id() {
return Thread::get_caller_id();
};

bool _OS::has_feature(const String &p_feature) const {
return OS::get_singleton()->has_feature(p_feature);
}
Expand Down Expand Up @@ -758,6 +762,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_caller_id"), &_OS::get_caller_id);

ClassDB::bind_method(D_METHOD("has_feature", "tag_name"), &_OS::has_feature);

Expand Down
1 change: 1 addition & 0 deletions core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class _OS : public Object {
String get_user_data_dir() const;

Error set_thread_name(const String &p_name);
Thread::ID get_caller_id();

bool has_feature(const String &p_feature) const;

Expand Down

0 comments on commit 1feed85

Please sign in to comment.