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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 21e25cd2266..63cb26cb6eb 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -113,6 +113,7 @@ namespace mongo {
_threadId(boost::this_thread::get_id()),
_connectionId(p ? p->connectionId() : 0),
_god(0),
+ _txn(NULL),
_lastOp(0),
_shutdown(false) {
@@ -329,8 +330,14 @@ namespace mongo {
if (_connectionId) {
builder.appendNumber("connectionId", _connectionId);
}
+ }
+
+ void Client::setOperationContext(OperationContext* txn) {
+ // We can only set or unset the OperationContexts, never swap them.
+ invariant((txn == NULL) ^ (_txn == NULL));
- _curOp->reportState(&builder);
+ boost::unique_lock<SpinLock> uniqueLock(_lock);
+ _txn = txn;
}
string Client::clientAddress(bool includePort) const {