Skip to content

Commit cd558b4

Browse files
philmb3487pitwuu@gmail.com
authored andcommitted
FreeBSD, OpenBSD thread renaming.
1 parent bc8535b commit cd558b4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/util.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
#include "config/bitcoin-config.h"
88
#endif
99

10+
#if (defined(__FreeBSD__) || defined(__OpenBSD__))
11+
#include <pthread.h>
12+
#include <pthread_np.h>
13+
#endif
14+
1015
#include "util.h"
1116

1217
#include "chainparamsbase.h"
@@ -707,10 +712,7 @@ void RenameThread(const char* name)
707712
#if defined(PR_SET_NAME)
708713
// Only the first 15 characters are used (16 - NUL terminator)
709714
::prctl(PR_SET_NAME, name, 0, 0, 0);
710-
#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__))
711-
// TODO: This is currently disabled because it needs to be verified to work
712-
// on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
713-
// removed.
715+
#elif (defined(__FreeBSD__) || defined(__OpenBSD__))
714716
pthread_set_name_np(pthread_self(), name);
715717

716718
#elif defined(MAC_OSX)

0 commit comments

Comments
 (0)