diff options
author | Ariel Manzur <ariel@godotengine.org> | 2015-12-17 06:24:27 -0300 |
---|---|---|
committer | Ariel Manzur <ariel@godotengine.org> | 2015-12-17 06:24:27 -0300 |
commit | 10298b9534937c8662fe6bea6dcf79457bd53970 (patch) | |
tree | f329c7c04aa20a5e6d1b3fd4a7d366bbf49842cc /core/bind/core_bind.cpp | |
parent | 6c3c20fc35cfe324a55409bd3d8fb0f0028774fe (diff) |
thread set name
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r-- | core/bind/core_bind.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 30c90bd71c..743ae19a93 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1941,6 +1941,9 @@ Error _Thread::start(Object *p_instance,const StringName& p_method,const Variant return ERR_CANT_CREATE; } + if (name != "") + thread->set_name(name); + return OK; } @@ -1972,12 +1975,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 ); |