Skip to content

Commit 4af72d8

Browse files
committed
Merge bitcoin/bitcoin#32647: build: add -Wthread-safety-pointer
83bfe14 build: add -Wthread-safety-pointer (fanquake) 240a4fb Squashed 'src/leveldb/' changes from 113db4962b..aba469ad6a (fanquake) Pull request description: This will become available in Clang 21: > ThreadSafetyAnalysis now supports -Wthread-safety-pointer, which > enables warning on passing or returning pointers to guarded variables > as function arguments or return value respectively. Note that > ThreadSafetyAnalysis still does not perform alias analysis. The > feature will be default-enabled with -Wthread-safety in a future release. See https://github.com/llvm/llvm-project/blob/main/clang/docs/ReleaseNotes.rst. Also updates the leveldb subtree to pull: bitcoin-core/leveldb-subtree#54. ACKs for top commit: davidgumberg: Tested ACK bitcoin/bitcoin@83bfe14 maflcko: lgtm ACK 83bfe14 theuni: utACK 83bfe14 Tree-SHA512: 9bc80bd04a9cebed8aca20bc23a17e52a6a89a1fb042993322f43dbf7bd93de509c091ebb69255063833b098ab11a64285eccf61e17b9f94f974c734a20ad8da
2 parents a980918 + 83bfe14 commit 4af72d8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ else()
443443
try_append_cxx_flags("-Wvla" TARGET warn_interface SKIP_LINK)
444444
try_append_cxx_flags("-Wshadow-field" TARGET warn_interface SKIP_LINK)
445445
try_append_cxx_flags("-Wthread-safety" TARGET warn_interface SKIP_LINK)
446+
try_append_cxx_flags("-Wthread-safety-pointer" TARGET warn_interface SKIP_LINK)
446447
try_append_cxx_flags("-Wloop-analysis" TARGET warn_interface SKIP_LINK)
447448
try_append_cxx_flags("-Wredundant-decls" TARGET warn_interface SKIP_LINK)
448449
try_append_cxx_flags("-Wunused-member-function" TARGET warn_interface SKIP_LINK)

src/leveldb/util/cache.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ class LRUCache {
171171
private:
172172
void LRU_Remove(LRUHandle* e);
173173
void LRU_Append(LRUHandle* list, LRUHandle* e);
174-
void Ref(LRUHandle* e);
175-
void Unref(LRUHandle* e);
174+
void Ref(LRUHandle* e) EXCLUSIVE_LOCKS_REQUIRED(mutex_);
175+
void Unref(LRUHandle* e) EXCLUSIVE_LOCKS_REQUIRED(mutex_);
176176
bool FinishErase(LRUHandle* e) EXCLUSIVE_LOCKS_REQUIRED(mutex_);
177177

178178
// Initialized before use.

0 commit comments

Comments
 (0)