From d5a64253ec86e8b297bec6c57f9fbd3ddcfe008e Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Wed, 6 Jul 2016 17:01:43 +0200 Subject: [PATCH] fix: add missing mutex --- arangod/V8Server/V8PeriodicTask.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arangod/V8Server/V8PeriodicTask.cpp b/arangod/V8Server/V8PeriodicTask.cpp index ab304db256..f5cbe01187 100644 --- a/arangod/V8Server/V8PeriodicTask.cpp +++ b/arangod/V8Server/V8PeriodicTask.cpp @@ -41,6 +41,7 @@ Mutex V8PeriodicTask::RUNNING_LOCK; void V8PeriodicTask::jobDone(Task* task) { try { + MUTEX_LOCKER(guard, V8PeriodicTask::RUNNING_LOCK); RUNNING.erase(task); } catch (...) { // ignore any memory error @@ -48,7 +49,7 @@ void V8PeriodicTask::jobDone(Task* task) { } V8PeriodicTask::V8PeriodicTask(std::string const& id, std::string const& name, - TRI_vocbase_t* vocbase, + TRI_vocbase_t* vocbase, double offset, double period, std::string const& command, std::shared_ptr parameters, @@ -87,7 +88,7 @@ bool V8PeriodicTask::handlePeriod() { LOG(WARN) << "could not add task " << _command << ", no dispatcher known"; return false; } - + { MUTEX_LOCKER(guard, V8PeriodicTask::RUNNING_LOCK); @@ -102,7 +103,7 @@ bool V8PeriodicTask::handlePeriod() { std::unique_ptr job(new V8Job( _vocbase, "(function (params) { " + _command + " } )(params);", _parameters, _allowUseDatabase, this)); - + DispatcherFeature::DISPATCHER->addJob(job, false); return true;