summaryrefslogtreecommitdiff
path: root/src/mongo/db/session_catalog.h
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2018-09-24 16:43:58 -0400
committerSpencer T Brody <spencer@mongodb.com>2018-09-28 13:15:08 -0400
commit9406af079a894bae80fbbec4703b04974bf84476 (patch)
tree3981fb0e4b129713f84cf34b38a7d56001e9f60e /src/mongo/db/session_catalog.h
parent56aa77807e5ff288635b69c40bf4d201e715051d (diff)
downloadmongo-9406af079a894bae80fbbec4703b04974bf84476.tar.gz
SERVER-35870 Allow more than one thread to block Session checkout at a time
Diffstat (limited to 'src/mongo/db/session_catalog.h')
-rw-r--r--src/mongo/db/session_catalog.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h
index e4ca4dda0d6..97bad1e279e 100644
--- a/src/mongo/db/session_catalog.h
+++ b/src/mongo/db/session_catalog.h
@@ -163,6 +163,10 @@ private:
*/
void _releaseSession(const LogicalSessionId& lsid);
+ bool _isSessionCheckoutAllowed() const {
+ return _preventSessionCheckoutRequests == 0;
+ };
+
// Protects members below.
stdx::mutex _mutex;
@@ -172,8 +176,8 @@ private:
// Count of the number of Sessions that are currently checked out.
uint32_t _numCheckedOutSessions{0};
- // Set to false to cause all Session checkout or creation requests to block.
- bool _allowCheckingOutSessions{true};
+ // When >0 all Session checkout or creation requests will block.
+ uint32_t _preventSessionCheckoutRequests{0};
// Condition that is signaled when the number of checked out sessions goes to 0.
stdx::condition_variable _allSessionsCheckedInCond;