mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 05:50:14 +00:00
fix holding lock during sleep
oops
This commit is contained in:
1 file changed
+7
-2
+7
-2
@@ -135,8 +135,13 @@ void TLuaEngine::operator()() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::unique_lock Lock(mLuaStatesMutex);
|
bool StatesEmpty = false;
|
||||||
if (mLuaStates.empty()) {
|
{
|
||||||
|
std::unique_lock Lock(mLuaStatesMutex);
|
||||||
|
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 {
|
||||||
|
|||||||
Reference in new issue
Block a user