mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:07:42 +00:00
Another race condition fix
This commit is contained in:
@@ -77,6 +77,7 @@ void ClientProcess::Worker::proc()
|
||||
lk.lock();
|
||||
m_proc.m_completedQueue.push_back(std::move(trans));
|
||||
}
|
||||
m_proc.m_waitCv.notify_one();
|
||||
if (!m_proc.m_running)
|
||||
break;
|
||||
m_proc.m_cv.wait(lk);
|
||||
@@ -154,6 +155,13 @@ void ClientProcess::swapCompletedQueue(std::list<std::unique_ptr<Transaction>>&
|
||||
queue.swap(m_completedQueue);
|
||||
}
|
||||
|
||||
void ClientProcess::waitUntilComplete()
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
while (m_pendingQueue.size())
|
||||
m_waitCv.wait(lk);
|
||||
}
|
||||
|
||||
void ClientProcess::shutdown()
|
||||
{
|
||||
if (!m_running)
|
||||
|
||||
Reference in New Issue
Block a user