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 committed 2023-02-17 11:42:40 +01:00
1 parent bc35c4f58c
commit 3df37e0c78
1 file changed
+3 -1
+3 -1
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