mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
net: fMsgProcWake use LOCK instead of lock_guard
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user