- MutexLocker locker(m_shared.m_phaseLock);
- while (m_shared.m_gcThreadsShouldWait)
- m_shared.m_phaseCondition.wait(m_shared.m_phaseLock);
+ std::unique_lock<std::mutex> lock(m_shared.m_phaseMutex);
+ m_shared.m_phaseConditionVariable.wait(lock, [this] { return !m_shared.m_gcThreadsShouldWait; });