From eb67f483b2740b848c89863abc910ea0a237cf73 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Mon, 29 Nov 2021 03:07:20 +0100 Subject: [PATCH] Another possible fix for deadlock --- src/TLuaEngine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index 6881cfc..d814a22 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -64,8 +64,9 @@ void TLuaEngine::operator()() { if (Waited > 250) { // FIXME: This should *eventually* timeout. // beammp_lua_error(Res->Function + " in " + Res->StateId + " took >1s to respond, not printing possible errors"); - std::unique_lock Lock(mResultsToCheckMutex); + Lock.lock(); mResultsToCheck.push(Res); + Lock.unlock(); break; } }