diff options
author | Spencer T Brody <spencer@mongodb.com> | 2015-05-29 18:14:03 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2015-05-29 18:14:03 -0400 |
commit | 993fc5e4ed9264965f16a948d3732d3fc55d1255 (patch) | |
tree | d5288061d1d0e10bc499e37d728c40ce83bcb06f /src/mongo/db/client.h | |
parent | e181ea38af737ef7aaf5f8228f870d8c7149b2bb (diff) | |
download | mongo-993fc5e4ed9264965f16a948d3732d3fc55d1255.tar.gz |
Revert "SERVER-18277 Clarify locking of Client when accessing its stored OperationContext."
This reverts commit 5c2d133871b2ad2adf6c617364d036ca25261f2d.
Diffstat (limited to 'src/mongo/db/client.h')
-rw-r--r-- | src/mongo/db/client.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h index 597ed07dd70..63750b69523 100644 --- a/src/mongo/db/client.h +++ b/src/mongo/db/client.h @@ -86,29 +86,11 @@ namespace mongo { void lock() { _lock.lock(); } void unlock() { _lock.unlock(); } - /** - * Sets the active operation context on this client to "txn", which must be non-NULL. - * - * It is an error to call this method if there is already an operation context on Client. - * It is an error to call this on an unlocked client. - */ + // Changes the currently active operation context on this client. There can only be one + // active OperationContext at a time. void setOperationContext(OperationContext* txn); - - /** - * Clears the active operation context on this client. - * - * There must already be such a context set on this client. - * It is an error to call this on an unlocked client. - */ void resetOperationContext(); - - /** - * Gets the operation context active on this client, or nullptr if there is no such context. - * - * It is an error to call this method on an unlocked client, or to use the value returned - * by this method while the client is not locked. - */ - OperationContext* getOperationContext() { return _txn; } + const OperationContext* getOperationContext() const { return _txn; } // TODO(spencer): SERVER-10228 SERVER-14779 Remove this/move it fully into OperationContext. bool isInDirectClient() const { return _inDirectClient; } |