summaryrefslogtreecommitdiffstats
path: root/core/bind/core_bind.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-12-21 09:07:06 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-12-21 09:07:06 -0300
commit15429d6ac95acb044c9eebd64356f33e7e5d14ef (patch)
tree872a375b64d93fd6aaf1239e058a13630c9cfabe /core/bind/core_bind.cpp
parent81f62fb78c7f3c133ef764a99dcdf05077d8ced9 (diff)
parentb2f670ebaefa16b0345f9a7ae825f78dbfdec9f8 (diff)
downloadredot-engine-15429d6ac95acb044c9eebd64356f33e7e5d14ef.tar.gz
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r--core/bind/core_bind.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 30c90bd71c..438db5d518 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -1883,6 +1883,14 @@ 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);
+ };
+
t->ret=t->target_instance->call(t->target_method,arg,1,ce);
if (ce.error!=Variant::CallError::CALL_OK) {
@@ -1972,12 +1980,24 @@ 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 );