summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.h
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-01-23 13:18:49 -0500
committerJason Carey <jcarey@argv.me>2019-02-05 22:41:49 -0500
commita23cdb1bd0f8fbe9cd79db08a24b8a89dc54ff81 (patch)
tree1adc2fdb36e6c8babaab134d53f84de3020c2404 /src/mongo/db/operation_context.h
parent5fd66f15797c45c9bab7b59f9e55e0a2f7ad5cd0 (diff)
downloadmongo-a23cdb1bd0f8fbe9cd79db08a24b8a89dc54ff81.tar.gz
SERVER-39146 Refactor Baton
Refactor the baton into regular and networking batons while also cleaning up the basic baton implementation.
Diffstat (limited to 'src/mongo/db/operation_context.h')
-rw-r--r--src/mongo/db/operation_context.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index 389797c2e1c..f376a98e048 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -184,14 +184,14 @@ public:
/**
* Sets a transport Baton on the operation. This will trigger the Baton on markKilled.
*/
- void setBaton(const transport::BatonHandle& baton) {
+ void setBaton(const BatonHandle& baton) {
_baton = baton;
}
/**
* Retrieves the baton associated with the operation.
*/
- const transport::BatonHandle& getBaton() const {
+ const BatonHandle& getBaton() const {
return _baton;
}
@@ -436,13 +436,17 @@ private:
// A transport Baton associated with the operation. The presence of this object implies that a
// client thread is doing it's own async networking by blocking on it's own thread.
- transport::BatonHandle _baton;
+ BatonHandle _baton;
// If non-null, _waitMutex and _waitCV are the (mutex, condition variable) pair that the
// operation is currently waiting on inside a call to waitForConditionOrInterrupt...().
+ //
+ // _waitThread is the calling thread's thread id.
+ //
// All access guarded by the Client's lock.
stdx::mutex* _waitMutex = nullptr;
stdx::condition_variable* _waitCV = nullptr;
+ stdx::thread::id _waitThread;
// If _waitMutex and _waitCV are non-null, this is the number of threads in a call to markKilled
// actively attempting to kill the operation. If this value is non-zero, the operation is inside