aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-05-21 10:25:56 +0100
committermerge-script <fanquake@gmail.com>2024-05-21 10:25:56 +0100
commit8804ec736adaacf5392392add003e679069ad527 (patch)
tree52116c6bcf0a85fa2a6a7357c3933844ab8cfad6 /test
parent5acdc2b97dcd756a15d28d75bce9a9d3e3953f9f (diff)
parentd35ba1b3f16071b8fe9b36398ba15352dbf2a54d (diff)
downloadbitcoin-8804ec736adaacf5392392add003e679069ad527.tar.xz
Merge bitcoin/bitcoin#30095: util: avoid using thread_local variable that has a destructor
d35ba1b3f16071b8fe9b36398ba15352dbf2a54d util: avoid using thread_local variable that has a destructor (Vasil Dimov) Pull request description: Store the thread name in a `thread_local` variable of type `char[]` instead of `std::string`. This avoids calling the destructor when the thread exits. This is a workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278701 For type-safety, return `std::string` from `util::ThreadGetInternalName()` instead of `char[]`. As a side effect of this change, we no longer store a reference to a `thread_local` variable in `CLockLocation`. This was dangerous because if the thread quits while the reference still exists (in the global variable `lock_data`, see inside `GetLockData()`) then the reference will become dangling. ACKs for top commit: laanwj: Code review ACK d35ba1b3f16071b8fe9b36398ba15352dbf2a54d hebasto: re-ACK d35ba1b3f16071b8fe9b36398ba15352dbf2a54d. theuni: utACK d35ba1b3f16071b8fe9b36398ba15352dbf2a54d Tree-SHA512: a2a3bc4401654d6e99db5b9c46a7051855f5a26886142298662e681b78dd581ff4c6bebe42f649b8e1fb8a78d569c6117302db2cd6362e884a22f2a5839b7d43
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions