Fix tcp_timeout_monitor abort

This commit is contained in:
Eladash 2023-12-17 23:45:15 +02:00 committed by Elad Ashkenazi
parent 9f0cb9148f
commit 7e853abc4b

View File

@ -74,6 +74,12 @@ public:
while (thread_ctrl::state() != thread_state::aborting)
{
std::unique_lock<std::mutex> lock(data_mutex);
if (thread_ctrl::state() == thread_state::aborting)
{
break;
}
if (msgs.size())
wakey.wait_until(lock, msgs.begin()->first);
else
@ -150,6 +156,8 @@ public:
tcp_timeout_monitor& operator=(thread_state)
{
data_mutex.lock();
data_mutex.unlock();
wakey.notify_one();
return *this;
}