From c01f2977ac86d22410b0fc997f560dcac972e8fe Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 28 Jul 2015 22:29:58 -0700 Subject: [PATCH] StorageEntry: Make value() const. --- src/Storage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Storage.h b/src/Storage.h index 74a0c3429d..4878779e45 100644 --- a/src/Storage.h +++ b/src/Storage.h @@ -33,7 +33,7 @@ class StorageEntry { bool IsPersistent() const { return (m_flags & NT_PERSISTENT) != 0; } - std::shared_ptr value() { + std::shared_ptr value() const { #ifdef HAVE_SHARED_PTR_ATOMIC_LOAD return std::atomic_load(&m_value); #else @@ -66,7 +66,7 @@ class StorageEntry { // atomic accesses. Unfortunately, atomic shared_ptr is not yet available // on most compilers, so we need an explicit mutex instead. #ifndef HAVE_SHARED_PTR_ATOMIC_LOAD - std::mutex m_value_mutex; + mutable std::mutex m_value_mutex; #endif std::shared_ptr m_value; std::atomic_uint m_flags;