mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-20 14:05:23 +01:00
doc: clarify that LOCK() does AssertLockNotHeld() internally
Constructs like ```cpp AssertLockNotHeld(m); LOCK(m); ``` are equivalent to ```cpp LOCK(m); ``` for non-recursive mutexes, so it is ok to omit `AssertLockNotHeld()` in such cases.
This commit is contained in:
parent
bc35c4f58c
commit
3df37e0c78
1 changed files with 3 additions and 1 deletions
|
@ -941,7 +941,9 @@ Threads and synchronization
|
|||
internal to a class (private or protected) rather than public.
|
||||
|
||||
- Combine annotations in function declarations with run-time asserts in
|
||||
function definitions:
|
||||
function definitions (`AssertLockNotHeld()` can be omitted if `LOCK()` is
|
||||
called unconditionally after it because `LOCK()` does the same check as
|
||||
`AssertLockNotHeld()` internally, for non-recursive mutexes):
|
||||
|
||||
```C++
|
||||
// txmempool.h
|
||||
|
|
Loading…
Add table
Reference in a new issue