From: bert hubert Date: Fri, 26 Feb 2016 17:12:21 +0000 (+0100) Subject: in dnsdist maintenance thread we'd lock up trying to lock g_luamutex twice X-Git-Tag: rec-4.0.0-alpha2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=069e59db0394de9d059e15b338e34fd8823f0326;p=thirdparty%2Fpdns.git in dnsdist maintenance thread we'd lock up trying to lock g_luamutex twice --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index a793a15d92..b0447bb9cd 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1012,10 +1012,12 @@ void* maintThread() for(;;) { sleep(interval); - std::lock_guard lock(g_luamutex); - auto f =g_lua.readVariable > >("maintenance"); - if(f) - (*f)(); + { + std::lock_guard lock(g_luamutex); + auto f =g_lua.readVariable > >("maintenance"); + if(f) + (*f)(); + } counter++; if (counter >= g_cacheCleaningDelay) {