summaryrefslogtreecommitdiff
path: root/src/mongo/db/client.h
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@10gen.com>2020-01-16 20:44:59 +0000
committerevergreen <evergreen@mongodb.com>2020-01-16 20:44:59 +0000
commit7ba6fede8aab0ab8a77515d7c11a017b213d8f93 (patch)
tree5b28127f9feefb4db1202a02c61e61371c647f37 /src/mongo/db/client.h
parentbb6e5391a9591139804038b3524a1b92ad1c327b (diff)
downloadmongo-7ba6fede8aab0ab8a77515d7c11a017b213d8f93.tar.gz
SERVER-45212 Add try_lock() to SpinLock
Diffstat (limited to 'src/mongo/db/client.h')
-rw-r--r--src/mongo/db/client.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h
index 6aea69b5c2a..64c0e7407c7 100644
--- a/src/mongo/db/client.h
+++ b/src/mongo/db/client.h
@@ -152,6 +152,9 @@ public:
void unlock() {
_lock.unlock();
}
+ bool try_lock() {
+ return _lock.try_lock();
+ }
/**
* Makes a new operation context representing an operation on this client. At most