Skip to content

Commit

Permalink
FreeBSD, OpenBSD thread renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmb3487 authored and [email protected] committed Apr 20, 2015
1 parent bc8535b commit cd558b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#include "config/bitcoin-config.h"
#endif

#if (defined(__FreeBSD__) || defined(__OpenBSD__))
#include <pthread.h>
#include <pthread_np.h>
#endif

#include "util.h"

#include "chainparamsbase.h"
Expand Down Expand Up @@ -707,10 +712,7 @@ void RenameThread(const char* name)
#if defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif 0 && (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.
#elif (defined(__FreeBSD__) || defined(__OpenBSD__))
pthread_set_name_np(pthread_self(), name);

#elif defined(MAC_OSX)
Expand Down

0 comments on commit cd558b4

Please sign in to comment.