diff options
author | Dan Larkin-York <dan.larkin-york@mongodb.com> | 2021-10-21 18:14:18 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-21 19:08:28 +0000 |
commit | eedf0b9248334af020e16c7de6d5c9392d1981d7 (patch) | |
tree | a4ab47eda0069083c1b71eae2f5557fffa905729 /src/mongo/db/concurrency/lock_state.h | |
parent | 065c37d4162355caadddf32d49360ee417b6fa86 (diff) | |
download | mongo-eedf0b9248334af020e16c7de6d5c9392d1981d7.tar.gz |
SERVER-59219 Check oplog visibility lock semantics for possible deadlock
Diffstat (limited to 'src/mongo/db/concurrency/lock_state.h')
-rw-r--r-- | src/mongo/db/concurrency/lock_state.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/concurrency/lock_state.h b/src/mongo/db/concurrency/lock_state.h index c266269d47a..445c24235b8 100644 --- a/src/mongo/db/concurrency/lock_state.h +++ b/src/mongo/db/concurrency/lock_state.h @@ -32,6 +32,7 @@ #include <queue> #include "mongo/db/concurrency/fast_map_noalloc.h" +#include "mongo/db/concurrency/lock_manager_defs.h" #include "mongo/db/concurrency/locker.h" #include "mongo/db/operation_context.h" #include "mongo/platform/atomic_word.h" @@ -206,6 +207,14 @@ public: virtual void releaseTicket(); virtual void reacquireTicket(OperationContext* opCtx); + bool hasReadTicket() const override { + return _modeForTicket == MODE_IS || _modeForTicket == MODE_S; + } + + bool hasWriteTicket() const override { + return _modeForTicket == MODE_IX || _modeForTicket == MODE_X; + } + void getFlowControlTicket(OperationContext* opCtx, LockMode lockMode) override; FlowControlTicketholder::CurOp getFlowControlStats() const override; |