mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #19979: Replace LockAssertion with AssertLockHeld, remove LockAssertion
0bd1184adfRemove unused LockAssertion struct (Hennadii Stepanov)ab2a44297fReplace LockAssertion with a proper thread safety annotations (Hennadii Stepanov)73f71e1996refactor: Use explicit function type instead of template (Hennadii Stepanov) Pull request description: This PR replaces `LockAssertion` with `AssertLockHeld`, and removes `LockAssertion`. This PR is compared with alternatives in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/AssertLockHeld-PRs ACKs for top commit: MarcoFalke: ACK0bd1184adfajtowns: ACK0bd1184adfvasild: ACK0bd1184adTree-SHA512: ef7780dd689faf0bb479fdb97c49bc652e2dd10c148234bb95502dfbb676442d8565ee37864d923ca21a25f9dc2a335bf46ee82c095e387b59a664ab05c0ae41
This commit is contained in:
@@ -258,8 +258,8 @@ public:
|
||||
|
||||
void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);
|
||||
|
||||
template<typename Callable>
|
||||
void ForEachNode(Callable&& func)
|
||||
using NodeFn = std::function<void(CNode*)>;
|
||||
void ForEachNode(const NodeFn& func)
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
for (auto&& node : vNodes) {
|
||||
@@ -268,8 +268,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Callable>
|
||||
void ForEachNode(Callable&& func) const
|
||||
void ForEachNode(const NodeFn& func) const
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
for (auto&& node : vNodes) {
|
||||
|
||||
Reference in New Issue
Block a user