summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/counttests.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2016-04-16 12:24:16 -0400
committerAndy Schwerin <schwerin@mongodb.com>2016-04-18 23:44:56 -0400
commit0ab34aa7b9c3c48ea6cf17888620fca455284d35 (patch)
tree9d592c0427229b53bdea159617f7de5d3c6ff819 /src/mongo/dbtests/counttests.cpp
parentbdc06761206ac398af04f0a2eb482c4dca49bad8 (diff)
downloadmongo-0ab34aa7b9c3c48ea6cf17888620fca455284d35.tar.gz
SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext().
Also, make OperationContextImpl's constructor private so that it can only be constructed via a Client.
Diffstat (limited to 'src/mongo/dbtests/counttests.cpp')
-rw-r--r--src/mongo/dbtests/counttests.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/dbtests/counttests.cpp b/src/mongo/dbtests/counttests.cpp
index 855113d66ec..f6f0f48c858 100644
--- a/src/mongo/dbtests/counttests.cpp
+++ b/src/mongo/dbtests/counttests.cpp
@@ -28,13 +28,15 @@
* then also delete it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/collection.h"
+#include "mongo/db/client.h"
#include "mongo/db/db.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/json.h"
-#include "mongo/db/operation_context_impl.h"
#include "mongo/stdx/thread.h"
#include "mongo/dbtests/dbtests.h"
@@ -44,8 +46,7 @@ namespace CountTests {
class Base {
public:
Base()
- : _txn(),
- _scopedXact(&_txn, MODE_IX),
+ : _scopedXact(&_txn, MODE_IX),
_lk(_txn.lockState(), nsToDatabaseSubstring(ns()), MODE_X),
_context(&_txn, ns()),
_client(&_txn) {
@@ -104,7 +105,8 @@ protected:
}
- OperationContextImpl _txn;
+ const ServiceContext::UniqueOperationContext _txnPtr = cc().makeOperationContext();
+ OperationContext& _txn = *_txnPtr;
ScopedTransaction _scopedXact;
Lock::DBLock _lk;