FreeBSD, OpenBSD thread renaming.

This commit is contained in:
sinetek 2015-04-21 02:43:33 +07:00 committed by pitwuu@gmail.com
parent bc8535b717
commit cd558b421c

View file

@ -7,6 +7,11 @@
#include "config/bitcoin-config.h" #include "config/bitcoin-config.h"
#endif #endif
#if (defined(__FreeBSD__) || defined(__OpenBSD__))
#include <pthread.h>
#include <pthread_np.h>
#endif
#include "util.h" #include "util.h"
#include "chainparamsbase.h" #include "chainparamsbase.h"
@ -707,10 +712,7 @@ void RenameThread(const char* name)
#if defined(PR_SET_NAME) #if defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator) // Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0); ::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__)) #elif (defined(__FreeBSD__) || defined(__OpenBSD__))
// TODO: This is currently disabled because it needs to be verified to work
// on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
// removed.
pthread_set_name_np(pthread_self(), name); pthread_set_name_np(pthread_self(), name);
#elif defined(MAC_OSX) #elif defined(MAC_OSX)