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) {
|
void V8PeriodicTask::jobDone(Task* task) {
|
||||||
try {
|
try {
|
||||||
|
MUTEX_LOCKER(guard, V8PeriodicTask::RUNNING_LOCK);
|
||||||
RUNNING.erase(task);
|
RUNNING.erase(task);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// ignore any memory error
|
// ignore any memory error
|
||||||
|
@ -48,7 +49,7 @@ void V8PeriodicTask::jobDone(Task* task) {
|
||||||
}
|
}
|
||||||
|
|
||||||
V8PeriodicTask::V8PeriodicTask(std::string const& id, std::string const& name,
|
V8PeriodicTask::V8PeriodicTask(std::string const& id, std::string const& name,
|
||||||
TRI_vocbase_t* vocbase,
|
TRI_vocbase_t* vocbase,
|
||||||
double offset, double period,
|
double offset, double period,
|
||||||
std::string const& command,
|
std::string const& command,
|
||||||
std::shared_ptr<VPackBuilder> parameters,
|
std::shared_ptr<VPackBuilder> parameters,
|
||||||
|
@ -87,7 +88,7 @@ bool V8PeriodicTask::handlePeriod() {
|
||||||
LOG(WARN) << "could not add task " << _command << ", no dispatcher known";
|
LOG(WARN) << "could not add task " << _command << ", no dispatcher known";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
MUTEX_LOCKER(guard, V8PeriodicTask::RUNNING_LOCK);
|
MUTEX_LOCKER(guard, V8PeriodicTask::RUNNING_LOCK);
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ bool V8PeriodicTask::handlePeriod() {
|
||||||
std::unique_ptr<Job> job(new V8Job(
|
std::unique_ptr<Job> job(new V8Job(
|
||||||
_vocbase, "(function (params) { " + _command + " } )(params);",
|
_vocbase, "(function (params) { " + _command + " } )(params);",
|
||||||
_parameters, _allowUseDatabase, this));
|
_parameters, _allowUseDatabase, this));
|
||||||
|
|
||||||
DispatcherFeature::DISPATCHER->addJob(job, false);
|
DispatcherFeature::DISPATCHER->addJob(job, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue