Problem: I can't refactor

Solution: fix ifdef check for pthread_setname
This commit is contained in:
Luca Boccassi 2017-03-12 13:11:11 +00:00
parent 33246f7a9e
commit 092ad50b0c

View File

@ -170,16 +170,16 @@ void zmq::thread_t::setThreadName(const char *name_)
if (!name_) if (!name_)
return; return;
#if defined(HAVE_PTHREAD_SETNAME_1) #if defined(ZMQ_HAVE_PTHREAD_SETNAME_1)
int rc = pthread_setname_np(name_); int rc = pthread_setname_np(name_);
posix_assert (rc); posix_assert (rc);
#elif defined(HAVE_PTHREAD_SETNAME_2) #elif defined(ZMQ_HAVE_PTHREAD_SETNAME_2)
int rc = pthread_setname_np(descriptor, name_); int rc = pthread_setname_np(descriptor, name_);
posix_assert (rc); posix_assert (rc);
#elif defined(HAVE_PTHREAD_SETNAME_3) #elif defined(ZMQ_HAVE_PTHREAD_SETNAME_3)
int rc = pthread_setname_np(descriptor, name_, NULL); int rc = pthread_setname_np(descriptor, name_, NULL);
posix_assert (rc); posix_assert (rc);
#elif defined(HAVE_PTHREAD_SET_NAME) #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME)
pthread_set_name_np(descriptor, name_); pthread_set_name_np(descriptor, name_);
#endif #endif
} }