summaryrefslogtreecommitdiff
path: root/src/mongo/db/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/client.cpp')
-rw-r--r--src/mongo/db/client.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 3bac054c2b1..a24e7a06453 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -41,6 +41,7 @@
#include "mongo/base/status.h"
#include "mongo/db/lasterror.h"
+#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
#include "mongo/stdx/thread.h"
#include "mongo/util/concurrency/thread_name.h"
@@ -145,6 +146,12 @@ Client* Client::getCurrent() {
return currentClient.get();
}
+std::unique_ptr<Locker> Client::swapLockState(std::unique_ptr<Locker> locker) {
+ scoped_spinlock scopedLock(_lock);
+ invariant(_opCtx);
+ return _opCtx->swapLockState(std::move(locker), scopedLock);
+}
+
Client& cc() {
invariant(haveClient());
return *Client::getCurrent();