aboutsummaryrefslogtreecommitdiff
path: root/core/bind/core_bind.cpp
diff options
context:
space:
mode:
authorAriel Manzur2016-01-31 20:22:38 -0300
committerAriel Manzur2016-01-31 20:23:24 -0300
commit0cd8c054a2070a9b91505d5f3a9addfe131352f1 (patch)
tree27118161c7a4dd8fe88c6a99e7bacceaa71be80d /core/bind/core_bind.cpp
parentb406aae790fe8f4cf331fa7fac629b418a674754 (diff)
downloadgodot-0cd8c054a2070a9b91505d5f3a9addfe131352f1.tar.gz
godot-0cd8c054a2070a9b91505d5f3a9addfe131352f1.tar.zst
godot-0cd8c054a2070a9b91505d5f3a9addfe131352f1.zip
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r--core/bind/core_bind.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 94d9e22a1..522c42928 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -390,6 +390,12 @@ bool _OS::is_ok_left_and_cancel_right() const {
return OS::get_singleton()->get_swap_ok_cancel();
}
+Error _OS::set_thread_name(const String& p_name) {
+
+ return Thread::set_name(p_name);
+};
+
+
/*
enum Weekday {
DAY_SUNDAY,
@@ -877,6 +883,8 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!"));
+ ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name);
+
BIND_CONSTANT( DAY_SUNDAY );
BIND_CONSTANT( DAY_MONDAY );
@@ -1895,13 +1903,7 @@ void _Thread::_start_func(void *ud) {
Variant::CallError ce;
const Variant* arg[1]={&t->userdata};
- // we don't know our thread pointer yet :(
- if (t->name == "") {
- // come up with a better name using maybe the filename on the Script?
- //t->thread->set_name(t->target_method);
- } else {
- //t->thread->set_name(t->name);
- };
+ Thread::set_name(t->target_method);
t->ret=t->target_instance->call(t->target_method,arg,1,ce);
if (ce.error!=Variant::CallError::CALL_OK) {
@@ -1992,24 +1994,12 @@ Variant _Thread::wait_to_finish() {
return r;
}
-Error _Thread::set_name(const String &p_name) {
-
- name = p_name;
-
- if (thread) {
- return thread->set_name(p_name);
- };
-
- return OK;
-};
-
void _Thread::_bind_methods() {
ObjectTypeDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL));
ObjectTypeDB::bind_method(_MD("get_id"),&_Thread::get_id);
ObjectTypeDB::bind_method(_MD("is_active"),&_Thread::is_active);
ObjectTypeDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish);
- ObjectTypeDB::bind_method(_MD("set_name:Error", "name"),&_Thread::set_name);
BIND_CONSTANT( PRIORITY_LOW );
BIND_CONSTANT( PRIORITY_NORMAL );