From f76a52b957c68ad0316a706472b2b807bf8db9cc Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 10 May 2020 21:06:38 -0400 Subject: [PATCH] Fix crash in module tests Former-commit-id: 37423757b54b2052512dcfeaba72ccbd360d3c1e --- .gitmodules | 3 +++ deps/depot_tools | 1 + src/module.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .gitmodules create mode 160000 deps/depot_tools diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..5c2d13b36 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/depot_tools"] + path = deps/depot_tools + url = https://chromium.googlesource.com/chromium/tools/depot_tools.git diff --git a/deps/depot_tools b/deps/depot_tools new file mode 160000 index 000000000..aaf566999 --- /dev/null +++ b/deps/depot_tools @@ -0,0 +1 @@ +Subproject commit aaf566999558aa8ead38811228cd539a6e6e2fda diff --git a/src/module.cpp b/src/module.cpp index 95116db77..c66701a9a 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -4701,13 +4701,14 @@ void moduleHandleBlockedClients(int iel) { if ((c != nullptr) && (iel != c->iel)) continue; + std::unique_lock ul; listDelNode(moduleUnblockedClients,ln); pthread_mutex_unlock(&moduleUnblockedClientsMutex); if (c) { AssertCorrectThread(c); - fastlock_lock(&c->lock); + ul = std::unique_lock(c->lock); } /* Release the lock during the loop, as long as we don't @@ -4773,7 +4774,6 @@ void moduleHandleBlockedClients(int iel) { /* Free 'bc' only after unblocking the client, since it is * referenced in the client blocking context, and must be valid * when calling unblockClient(). */ - fastlock_unlock(&c->lock); bc->module->blocked_clients--; zfree(bc);