aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-12-27 21:54:45 -0800
committerGarrett D'Amore <garrett@damore.org>2020-12-27 21:54:45 -0800
commit4048c91bf7862ba15fb8f132328f6fb1cf06cde1 (patch)
treef5d8296d7185ebccf158cc58b0ff7a75e85bd5bb /src/platform/posix
parent840f968d9318e07b0b7cde97b8461f330f8a4573 (diff)
downloadnng-4048c91bf7862ba15fb8f132328f6fb1cf06cde1.tar.gz
nng-4048c91bf7862ba15fb8f132328f6fb1cf06cde1.tar.bz2
nng-4048c91bf7862ba15fb8f132328f6fb1cf06cde1.zip
fixes #1363 build ios version fails
Diffstat (limited to 'src/platform/posix')
-rw-r--r--src/platform/posix/posix_thread.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/platform/posix/posix_thread.c b/src/platform/posix/posix_thread.c
index 0178455f..fe21c3b5 100644
--- a/src/platform/posix/posix_thread.c
+++ b/src/platform/posix/posix_thread.c
@@ -256,13 +256,7 @@ nni_plat_thr_is_self(nni_plat_thr *thr)
void
nni_plat_thr_set_name(nni_plat_thr *thr, const char *name)
{
-#if defined(NNG_HAVE_PTHREAD_SET_NAME_NP)
- if (thr == NULL) {
- pthread_set_name_np(pthread_self(), name);
- } else {
- pthread_set_name_np(thr->tid, name);
- }
-#elif defined(NNG_HAVE_PTHREAD_SETNAME_NP)
+#if defined(NNG_HAVE_PTHREAD_SETNAME_NP)
#if defined(__APPLE__)
// Darwin is weird, it can only set the name of pthread_self.
if ((thr == NULL) || (pthread_self() == thr->tid)) {
@@ -270,11 +264,17 @@ nni_plat_thr_set_name(nni_plat_thr *thr, const char *name)
}
#else
if (thr == NULL) {
- pthread_setname_np(pthread_self(), name);
+ pthread_setname_np(pthread_self(), name);
} else {
- pthread_setname_np(thr->tid, name);
+ pthread_setname_np(thr->tid, name);
}
#endif
+#elif defined(NNG_HAVE_PTHREAD_SET_NAME_NP)
+ if (thr == NULL) {
+ pthread_set_name_np(pthread_self(), name);
+ } else {
+ pthread_set_name_np(thr->tid, name);
+ }
#endif
}