Fix portability issue with pthreads#15968
Conversation
This change resolves the following issue: bitcoin#15951 Only tested on OpenBSD 6.5/amd64
|
tACK 1b05dff. Tested on OpenBSD6.4 ( Pre patch: CXX util/libbitcoin_util_a-rbf.o
CXX util/libbitcoin_util_a-threadnames.o
util/threadnames.cpp:26:5: error: use of undeclared identifier 'pthread_set_name_np'
pthread_set_name_np(pthread_self(), name);
^
1 error generated.
gmake[2]: *** [Makefile:8666: util/libbitcoin_util_a-threadnames.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....with this PR |
|
utACK 1b05dff |
|
Gitian builds for commit 3632143 (master):
Gitian builds for commit 1da169961518949bed9f1811e3d1345dedd4061a (master and this pull):
|
I agree that the most general way is best. I just followed the existing convention from https://github.com/bitcoin/bitcoin/blob/master/src/util/system.cpp : Is there anything else I need to do? |
|
No, it's ok, going to merge this, sorry for the delay. |
1b05dff Fix portability issue with pthreads (grim-trigger) Pull request description: This change resolves the following issue: #15951 Only tested on OpenBSD 6.5/amd64 ACKs for commit 1b05df: fanquake: tACK 1b05dff. Tested on OpenBSD6.4 (`vagrant`). laanwj: utACK 1b05dff Tree-SHA512: af48581af32820d5adc9ae5abb44f8f1b592c323f86fe2484108b81629389f6ef347598f9a087aa6476ac553e59828cd7927bb4ab11dc70e7c9a944a92fc54ae
1b05dff Fix portability issue with pthreads (grim-trigger) Pull request description: This change resolves the following issue: bitcoin#15951 Only tested on OpenBSD 6.5/amd64 ACKs for commit 1b05df: fanquake: tACK 1b05dff. Tested on OpenBSD6.4 (`vagrant`). laanwj: utACK 1b05dff Tree-SHA512: af48581af32820d5adc9ae5abb44f8f1b592c323f86fe2484108b81629389f6ef347598f9a087aa6476ac553e59828cd7927bb4ab11dc70e7c9a944a92fc54ae
Summary: Fixes the build on some *BSD. Backport of core [[bitcoin/bitcoin#15968 | PR15968]]. Depends on D5540 (and D5542 for the test plan). Test Plan: ninja check Build on FreeBSD 12.0. Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D5541
Thread names in logs and deadlock debug tools See merge request bitcoin-cash-node/bitcoin-cash-node!834 This is a backport of [PR15849](bitcoin/bitcoin#15849) (Thread names in logs and deadlock debug tools). See original PR for benchmarks. Also includes some smaller follow-up PR's: * [PR15968](bitcoin/bitcoin#15968) - Fix portability issue with pthreads * [PR16984](bitcoin/bitcoin#16984) - util: Make thread names shorter * [PR17038](bitcoin/bitcoin#17038) - Don't rename main thread at process level ## Test plan New tests: `ninja check` Run with `-logthreadnames`, observe lines are prefixed with thread ``` 2020-10-28T11:39:16Z [init] init message: Done loading 2020-10-28T11:39:16Z [opencon] opencon thread start 2020-10-28T11:39:16Z [dnsseed] 0 addresses found from DNS seeds 2020-10-28T11:39:16Z [msghand] msghand thread start 2020-10-28T11:39:16Z [dnsseed] dnsseed thread exit ``` Compile with lockorder debugging enabled: `cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..`
1b05dff Fix portability issue with pthreads (grim-trigger) Pull request description: This change resolves the following issue: bitcoin#15951 Only tested on OpenBSD 6.5/amd64 ACKs for commit 1b05df: fanquake: tACK 1b05dff. Tested on OpenBSD6.4 (`vagrant`). laanwj: utACK 1b05dff Tree-SHA512: af48581af32820d5adc9ae5abb44f8f1b592c323f86fe2484108b81629389f6ef347598f9a087aa6476ac553e59828cd7927bb4ab11dc70e7c9a944a92fc54ae
This change resolves the following issue:
#15951
Only tested on OpenBSD 6.5/amd64