From 25c57d640992255ed67964a44b17afbfd4bed0cf Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Tue, 16 Feb 2021 11:41:41 -0800 Subject: [doc] Add a note about where lock annotations should go. --- doc/developer-notes.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/developer-notes.md') 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 -- cgit v1.2.3