fix holding lock during sleep

oops
This commit is contained in:
Lion Kortlepel committed 2026-04-19 18:17:54 +00:00
1 parent 3e12e487ab
commit 98fb12bbcc
1 file changed
+6 -1
+6 -1
View File
@@ -135,8 +135,13 @@ void TLuaEngine::operator()() {
} }
} }
} }
bool StatesEmpty = false;
{
std::unique_lock Lock(mLuaStatesMutex); std::unique_lock Lock(mLuaStatesMutex);
if (mLuaStates.empty()) { StatesEmpty = mLuaStates.empty();
}
if (StatesEmpty) {
beammp_trace("No Lua states, event loop running extremely sparsely"); beammp_trace("No Lua states, event loop running extremely sparsely");
Application::SleepSafeSeconds(10); Application::SleepSafeSeconds(10);
} else { } else {