From 069e59db0394de9d059e15b338e34fd8823f0326 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 26 Feb 2016 18:12:21 +0100 Subject: [PATCH] in dnsdist maintenance thread we'd lock up trying to lock g_luamutex twice --- pdns/dnsdist.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) { -- 2.47.2