From f05b9437fbdc53deecf55ed3c20e36af3d733953 Mon Sep 17 00:00:00 2001 From: Charlie Swanson Date: Thu, 2 Mar 2017 13:54:24 -0500 Subject: SERVER-22541 Refactor RAII locking helpers. Removes the class 'ScopedTransaction' and moves the responsibility of abandoning the snapshot onto the GlobalLock class. Also renames the AutoGetCollectionForRead class to AutoGetCollectionForReadCommand, and adds a new AutoGetCollectionForRead class. Unlike AutoGetCollectionForReadCommand, this new class will not update the namespace on the CurrentOp object, nor will it add an entry to Top. --- src/mongo/db/restapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/restapi.cpp') diff --git a/src/mongo/db/restapi.cpp b/src/mongo/db/restapi.cpp index 532f0c81213..1869858f223 100644 --- a/src/mongo/db/restapi.cpp +++ b/src/mongo/db/restapi.cpp @@ -40,6 +40,7 @@ #include "mongo/db/auth/user_name.h" #include "mongo/db/background.h" #include "mongo/db/clientcursor.h" +#include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/dbhelpers.h" #include "mongo/db/dbwebserver.h" @@ -306,7 +307,7 @@ public: virtual void run(OperationContext* opCtx, stringstream& ss) { Timer t; - Lock::GlobalLock globalSLock(opCtx->lockState(), MODE_S, 300); + Lock::GlobalLock globalSLock(opCtx, MODE_S, 300); if (globalSLock.isLocked()) { _gotLock(t.millis(), ss); } else { -- cgit v1.2.1