summaryrefslogtreecommitdiff
path: root/drivers/unix/thread_posix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/thread_posix.cpp')
-rw-r--r--drivers/unix/thread_posix.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp
index fcefe0a3b3..54bbbf2dad 100644
--- a/drivers/unix/thread_posix.cpp
+++ b/drivers/unix/thread_posix.cpp
@@ -103,8 +103,6 @@ void ThreadPosix::wait_to_finish_func_posix(Thread *p_thread) {
Error ThreadPosix::set_name_func_posix(const String &p_name) {
- pthread_t running_thread = pthread_self();
-
#ifdef PTHREAD_NO_RENAME
return ERR_UNAVAILABLE;
@@ -117,6 +115,7 @@ Error ThreadPosix::set_name_func_posix(const String &p_name) {
#else
+ pthread_t running_thread = pthread_self();
#ifdef PTHREAD_BSD_SET_NAME
pthread_set_name_np(running_thread, p_name.utf8().get_data());
int err = 0; // Open/FreeBSD ignore errors in this function