diff options
-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(); } |