summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/locker.h
diff options
context:
space:
mode:
authorBruce Lucas <bruce.lucas@mongodb.com>2018-01-31 08:44:19 -0500
committerLouis Williams <louis.williams@mongodb.com>2018-02-20 12:44:06 -0500
commit5436c851b8322a0cb18611be0672f6a76d6e2f38 (patch)
tree927732ab12140ea0c4cb4c482ba1a363118f2cee /src/mongo/db/concurrency/locker.h
parent13b35bc5cfb20be89eb46dc50208d344caf305bb (diff)
downloadmongo-5436c851b8322a0cb18611be0672f6a76d6e2f38.tar.gz
SERVER-33233 Don't stall ftdc due to running out of tickets
Diffstat (limited to 'src/mongo/db/concurrency/locker.h')
-rw-r--r--src/mongo/db/concurrency/locker.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h
index 3e70d000fe8..ff133800115 100644
--- a/src/mongo/db/concurrency/locker.h
+++ b/src/mongo/db/concurrency/locker.h
@@ -334,11 +334,25 @@ public:
return _shouldConflictWithSecondaryBatchApplication;
}
+ /**
+ * If set to false, this opts out of the ticket mechanism. This should be used sparingly
+ * for special purpose threads, such as FTDC.
+ */
+ void setShouldAcquireTicket(bool newValue) {
+ invariant(!isLocked());
+ _shouldAcquireTicket = newValue;
+ }
+ bool shouldAcquireTicket() const {
+ return _shouldAcquireTicket;
+ }
+
+
protected:
Locker() {}
private:
bool _shouldConflictWithSecondaryBatchApplication = true;
+ bool _shouldAcquireTicket = true;
};
} // namespace mongo