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:
Vasil Dimov 2023-02-17 11:37:56 +01:00
parent bc35c4f58c
commit 3df37e0c78
No known key found for this signature in database
GPG key ID: 54DF06F64B55CBBF

View file

@ -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