diff options
| author | Anthony Towns <[email protected]> | 2019-05-30 13:44:02 +1000 |
|---|---|---|
| committer | Anthony Towns <[email protected]> | 2020-05-19 16:33:10 +1000 |
| commit | 8b5af3d4c1270267ad85e78f661bf8fab06f3aad (patch) | |
| tree | fb51d32074cfe24c9f92bfc6bf7c21069cbeda10 /src | |
| parent | wallet/wallet.h: Remove mutexScanning which was only protecting a single atom... (diff) | |
| download | discoin-8b5af3d4c1270267ad85e78f661bf8fab06f3aad.tar.xz discoin-8b5af3d4c1270267ad85e78f661bf8fab06f3aad.zip | |
net: fMsgProcWake use LOCK instead of lock_guard
Diffstat (limited to 'src')
| -rw-r--r-- | src/net.cpp | 6 | ||||
| -rw-r--r-- | src/net.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp index dcc613ba8..4e80e123d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1454,7 +1454,7 @@ void CConnman::ThreadSocketHandler() void CConnman::WakeMessageHandler() { { - std::lock_guard<std::mutex> lock(mutexMsgProc); + LOCK(mutexMsgProc); fMsgProcWake = true; } condMsgProc.notify_one(); @@ -2057,7 +2057,7 @@ void CConnman::ThreadMessageHandler() WAIT_LOCK(mutexMsgProc, lock); if (!fMoreWork) { - condMsgProc.wait_until(lock, std::chrono::steady_clock::now() + std::chrono::milliseconds(100), [this] { return fMsgProcWake; }); + condMsgProc.wait_until(lock, std::chrono::steady_clock::now() + std::chrono::milliseconds(100), [this]() EXCLUSIVE_LOCKS_REQUIRED(mutexMsgProc) { return fMsgProcWake; }); } fMsgProcWake = false; } @@ -2366,7 +2366,7 @@ static CNetCleanup instance_of_cnetcleanup; void CConnman::Interrupt() { { - std::lock_guard<std::mutex> lock(mutexMsgProc); + LOCK(mutexMsgProc); flagInterruptMsgProc = true; } condMsgProc.notify_all(); @@ -451,7 +451,7 @@ private: const uint64_t nSeed0, nSeed1; /** flag for waking the message processor. */ - bool fMsgProcWake; + bool fMsgProcWake GUARDED_BY(mutexMsgProc); std::condition_variable condMsgProc; Mutex mutexMsgProc; |