aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-12-11 07:26:27 -0800
committerChris Robinson <[email protected]>2015-12-11 07:26:27 -0800
commit13bf636a345b6caf65444c684b4a4c3b52fc263b (patch)
tree1c91cd90c590c40e04b8afa188bb3d74e1cece58
parent14df326876d92f63c9c007da3c0434fba47c30b8 (diff)
Use Apple's pthread_setname_np before GNU's
-rw-r--r--common/threads.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/threads.c b/common/threads.c
index 71fa6ab9..8a1ad6ea 100644
--- a/common/threads.c
+++ b/common/threads.c
@@ -497,11 +497,11 @@ extern inline void alcall_once(alonce_flag *once, void (*callback)(void));
void althrd_setname(althrd_t thr, const char *name)
{
#if defined(HAVE_PTHREAD_SETNAME_NP)
-#if defined(__GNUC__)
- pthread_setname_np(thr, name);
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
if(althrd_equal(thr, althrd_current())
pthread_setname_np(name);
+#elif defined(__GNUC__)
+ pthread_setname_np(thr, name);
#endif
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
pthread_set_name_np(thr, name);