Skip to content

Commit 0bd1184

Browse files
committed
Remove unused LockAssertion struct
1 parent ab2a442 commit 0bd1184

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

doc/developer-notes.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -793,25 +793,6 @@ bool ChainstateManager::ProcessNewBlock(...)
793793
}
794794
```
795795
796-
- When Clang Thread Safety Analysis is unable to determine if a mutex is locked, use `LockAssertion` class instances:
797-
798-
```C++
799-
// net_processing.h
800-
void RelayTransaction(...) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
801-
802-
// net_processing.cpp
803-
void RelayTransaction(...)
804-
{
805-
AssertLockHeld(::cs_main);
806-
807-
connman.ForEachNode([&txid, &wtxid](CNode* pnode) {
808-
LockAssertion lock(::cs_main);
809-
...
810-
});
811-
}
812-
813-
```
814-
815796
- Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential
816797
deadlocks are introduced. As of 0.12, this is defined by default when
817798
configuring with `--enable-debug`.

src/sync.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,4 @@ class CSemaphoreGrant
352352
}
353353
};
354354

355-
// Utility class for indicating to compiler thread analysis that a mutex is
356-
// locked (when it couldn't be determined otherwise).
357-
struct SCOPED_LOCKABLE LockAssertion
358-
{
359-
template <typename Mutex>
360-
explicit LockAssertion(Mutex& mutex) EXCLUSIVE_LOCK_FUNCTION(mutex)
361-
{
362-
#ifdef DEBUG_LOCKORDER
363-
AssertLockHeld(mutex);
364-
#endif
365-
}
366-
~LockAssertion() UNLOCK_FUNCTION() {}
367-
};
368-
369355
#endif // BITCOIN_SYNC_H

0 commit comments

Comments
 (0)