diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-08-20 16:09:14 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-08-21 17:04:20 -0400 |
commit | 11abe6693bf9cd070ae8ac050396212f73397956 (patch) | |
tree | 3e6e5ae06313a07b422b593b3a5c31f69ac6b90d /src/mongo/scripting | |
parent | 528ddd163be6d93f839d57cd068bd17ab55440cd (diff) | |
download | mongo-11abe6693bf9cd070ae8ac050396212f73397956.tar.gz |
SERVER-14371 SERVER-14143 killOp notification callback
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/engine.cpp | 1 | ||||
-rw-r--r-- | src/mongo/scripting/engine.h | 3 | ||||
-rw-r--r-- | src/mongo/scripting/engine_v8-3.25.cpp | 5 | ||||
-rw-r--r-- | src/mongo/scripting/engine_v8.cpp | 5 |
4 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index e6ffb6e309d..6567b13a67a 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -36,6 +36,7 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/client/dbclientinterface.h" +#include "mongo/db/global_environment_experiment.h" #include "mongo/platform/unordered_set.h" #include "mongo/util/file.h" #include "mongo/util/log.h" diff --git a/src/mongo/scripting/engine.h b/src/mongo/scripting/engine.h index 7a3d4b67a8b..9e959c55992 100644 --- a/src/mongo/scripting/engine.h +++ b/src/mongo/scripting/engine.h @@ -29,6 +29,7 @@ #pragma once +#include "mongo/db/global_environment_experiment.h" #include "mongo/db/jsobj.h" namespace mongo { @@ -187,7 +188,7 @@ namespace mongo { bool _lastRetIsNativeCode; // v8 only: set to true if eval'd script returns a native func }; - class ScriptEngine { + class ScriptEngine : public KillOpListenerInterface { MONGO_DISALLOW_COPYING(ScriptEngine); public: ScriptEngine(); diff --git a/src/mongo/scripting/engine_v8-3.25.cpp b/src/mongo/scripting/engine_v8-3.25.cpp index 392284cc2f3..8f7a89ad33c 100644 --- a/src/mongo/scripting/engine_v8-3.25.cpp +++ b/src/mongo/scripting/engine_v8-3.25.cpp @@ -34,6 +34,7 @@ #include "mongo/scripting/engine_v8-3.25.h" #include "mongo/base/init.h" +#include "mongo/db/global_environment_experiment.h" #include "mongo/platform/unordered_set.h" #include "mongo/scripting/v8-3.25_db.h" #include "mongo/scripting/v8-3.25_utils.h" @@ -374,6 +375,10 @@ namespace mongo { void ScriptEngine::setup() { if (!globalScriptEngine) { globalScriptEngine = new V8ScriptEngine(); + + if (hasGlobalEnvironment()) { + getGlobalEnvironment()->registerKillOpListener(globalScriptEngine); + } } } diff --git a/src/mongo/scripting/engine_v8.cpp b/src/mongo/scripting/engine_v8.cpp index d766a06fc50..71c14260441 100644 --- a/src/mongo/scripting/engine_v8.cpp +++ b/src/mongo/scripting/engine_v8.cpp @@ -34,6 +34,7 @@ #include "mongo/scripting/engine_v8.h" #include "mongo/base/init.h" +#include "mongo/db/global_environment_experiment.h" #include "mongo/platform/unordered_set.h" #include "mongo/scripting/v8_db.h" #include "mongo/scripting/v8_utils.h" @@ -352,6 +353,10 @@ namespace mongo { void ScriptEngine::setup() { if (!globalScriptEngine) { globalScriptEngine = new V8ScriptEngine(); + + if (hasGlobalEnvironment()) { + getGlobalEnvironment()->registerKillOpListener(globalScriptEngine); + } } } |