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 /drivers/unix/thread_posix.cpp | |
parent | 6c3c20fc35cfe324a55409bd3d8fb0f0028774fe (diff) | |
download | redot-engine-10298b9534937c8662fe6bea6dcf79457bd53970.tar.gz |
thread set name
Diffstat (limited to 'drivers/unix/thread_posix.cpp')
-rw-r--r-- | drivers/unix/thread_posix.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index 03963a9756..2f9adb3f6c 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -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() { |