diff options
| author | eska | 2016-01-09 15:56:31 +0100 |
|---|---|---|
| committer | eska | 2016-01-09 15:56:31 +0100 |
| commit | a6c1a5c6d0a1fd92fff3e499ce44ee4b0c5d1db3 (patch) | |
| tree | 741aaa29d28a3d7578554a32fddca4fa66613250 /drivers/unix/thread_posix.cpp | |
| parent | 9e143a52ba93243da55d425bd5dd3b9110d6bc2e (diff) | |
| download | godot-a6c1a5c6d0a1fd92fff3e499ce44ee4b0c5d1db3.tar.gz godot-a6c1a5c6d0a1fd92fff3e499ce44ee4b0c5d1db3.tar.zst godot-a6c1a5c6d0a1fd92fff3e499ce44ee4b0c5d1db3.zip | |
Diffstat (limited to 'drivers/unix/thread_posix.cpp')
| -rw-r--r-- | drivers/unix/thread_posix.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index 21bd95ead..bd33c8129 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -30,6 +30,10 @@ #if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) +#ifdef PTHREAD_BSD_SET_NAME +#include <pthread_np.h> +#endif + #include "os/memory.h" Thread::ID ThreadPosix::get_ID() const { @@ -100,9 +104,14 @@ Error ThreadPosix::set_name(const String& p_name) { #else + #ifdef PTHREAD_BSD_SET_NAME + pthread_set_name_np(pthread, p_name.utf8().get_data()); + int err = 0; // Open/FreeBSD ignore errors in this function + #else int err = pthread_setname_np(pthread, p_name.utf8().get_data()); + #endif // PTHREAD_BSD_SET_NAME - #endif + #endif // PTHREAD_RENAME_SELF return err == 0 ? OK : ERR_INVALID_PARAMETER; |
