diff options
Diffstat (limited to 'src/mongo/scripting/engine.cpp')
-rw-r--r-- | src/mongo/scripting/engine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index b5093581889..67edb2ca277 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -332,7 +332,7 @@ namespace { class ScopeCache { public: void release(const string& poolName, const std::shared_ptr<Scope>& scope) { - stdx::lock_guard<stdx::mutex> lk(_mutex); + stdx::lock_guard<Latch> lk(_mutex); if (scope->hasOutOfMemoryException()) { // make some room @@ -358,7 +358,7 @@ public: } std::shared_ptr<Scope> tryAcquire(OperationContext* opCtx, const string& poolName) { - stdx::lock_guard<stdx::mutex> lk(_mutex); + stdx::lock_guard<Latch> lk(_mutex); for (Pools::iterator it = _pools.begin(); it != _pools.end(); ++it) { if (it->poolName == poolName) { @@ -374,7 +374,7 @@ public: } void clear() { - stdx::lock_guard<stdx::mutex> lk(_mutex); + stdx::lock_guard<Latch> lk(_mutex); _pools.clear(); } @@ -391,7 +391,7 @@ private: typedef std::deque<ScopeAndPool> Pools; // More-recently used Scopes are kept at the front. Pools _pools; // protected by _mutex - stdx::mutex _mutex; + Mutex _mutex = MONGO_MAKE_LATCH("ScopeCache::_mutex"); }; ScopeCache scopeCache; |