diff options
author | Benety Goh <benety@mongodb.com> | 2018-04-04 23:11:34 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-04-04 23:11:34 -0400 |
commit | d07fe3bcfcb82a47a022a33f160797c5c91f07df (patch) | |
tree | 193bb8c1d2ba554b78ad57d7dbfcacf79c999984 | |
parent | 75160508e02cb5051f554baff3e67f2adb316057 (diff) | |
download | mongo-d07fe3bcfcb82a47a022a33f160797c5c91f07df.tar.gz |
SERVER-34301 make Notification<T> bool operation const
-rw-r--r-- | src/mongo/util/concurrency/notification.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/util/concurrency/notification.h b/src/mongo/util/concurrency/notification.h index 322138f4b9e..029e4c09bcc 100644 --- a/src/mongo/util/concurrency/notification.h +++ b/src/mongo/util/concurrency/notification.h @@ -57,7 +57,7 @@ public: * Returns true if the notification has been set (i.e., the call to get/waitFor would not * block). */ - explicit operator bool() { + explicit operator bool() const { stdx::unique_lock<stdx::mutex> lock(_mutex); return !!_value; } @@ -109,7 +109,7 @@ public: } private: - stdx::mutex _mutex; + mutable stdx::mutex _mutex; stdx::condition_variable _condVar; // Protected by mutex and only moves from not-set to set once @@ -119,7 +119,7 @@ private: template <> class Notification<void> { public: - explicit operator bool() { + explicit operator bool() const { return _notification.operator bool(); } |