thread set name

This commit is contained in:
Ariel Manzur
2015-12-17 06:24:27 -03:00
parent 6c3c20fc35
commit 10298b9534
7 changed files with 35 additions and 1 deletions

View File

@@ -77,6 +77,14 @@ void ThreadPosix::wait_to_finish_func_posix(Thread* p_thread) {
tp->pthread=0;
}
Error ThreadPosix::set_name(const String& p_name) {
ERR_FAIL_COND_V(pthread == 0, ERR_UNCONFIGURED);
int err = pthread_setname_np(pthread, p_name.utf8().get_data());
return err == 0 ? OK : ERR_INVALID_PARAMETER;
};
void ThreadPosix::make_default() {