core: add wait timeout to main thread

This commit is contained in:
Vaxry 2024-02-20 03:07:34 +00:00
parent 394dc81ff3
commit b23b0a6d32

View file

@ -185,7 +185,7 @@ void CHyprlock::run() {
while (1) {
std::unique_lock lk(m_sLoopState.eventRequestMutex);
if (m_sLoopState.event == false)
m_sLoopState.loopCV.wait(lk, [this] { return m_sLoopState.event; });
m_sLoopState.loopCV.wait_for(lk, std::chrono::milliseconds(5000), [this] { return m_sLoopState.event; });
if (m_bTerminate)
break;