aboutsummaryrefslogtreecommitdiff
path: root/doc/developer-notes.md
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-02-16 11:41:41 -0800
committerAmiti Uttarwar <amiti@uttarwar.org>2021-02-17 15:58:23 -0800
commit25c57d640992255ed67964a44b17afbfd4bed0cf (patch)
treeb7433842064b77f76bd643febf832bb84826ce94 /doc/developer-notes.md
parentad5f01b96045f304b6cf9100879592b835c49c40 (diff)
downloadbitcoin-25c57d640992255ed67964a44b17afbfd4bed0cf.tar.xz
[doc] Add a note about where lock annotations should go.
Diffstat (limited to 'doc/developer-notes.md')
-rw-r--r--doc/developer-notes.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 011c38321c..8f2d7af089 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -785,6 +785,11 @@ Threads and synchronization
get compile-time warnings about potential race conditions in code. Combine annotations in function declarations with
run-time asserts in function definitions:
+ - In functions that are declared separately from where they are defined, the
+ thread safety annotations should be added exclusively to the function
+ declaration. Annotations on the definition could lead to false positives
+ (lack of compile failure) at call sites between the two.
+
```C++
// txmempool.h
class CTxMemPool