mirror of https://gitee.com/bigwinds/arangodb
fix: add missing mutex
This commit is contained in:
parent
7996b2c152
commit
d5a64253ec
|
@ -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<VPackBuilder> 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> job(new V8Job(
|
||||
_vocbase, "(function (params) { " + _command + " } )(params);",
|
||||
_parameters, _allowUseDatabase, this));
|
||||
|
||||
|
||||
DispatcherFeature::DISPATCHER->addJob(job, false);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue