diff options
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() { |