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;