From 2c5fd56a6c04099722f6543987bb6fb26148604d Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 29 Dec 2013 11:52:54 +0100 Subject: [PATCH] use atomics for intrusive_ptr of shared_state --- include/boost/fiber/future/detail/shared_state.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/fiber/future/detail/shared_state.hpp b/include/boost/fiber/future/detail/shared_state.hpp index c0dccea1..407865e6 100644 --- a/include/boost/fiber/future/detail/shared_state.hpp +++ b/include/boost/fiber/future/detail/shared_state.hpp @@ -276,7 +276,7 @@ template< typename R > class shared_state< R & > : public noncopyable { private: - std::size_t use_count_; + atomic< std::size_t > use_count_; mutable mutex mtx_; mutable condition waiters_; bool ready_; @@ -467,7 +467,7 @@ template<> class shared_state< void > : public noncopyable { private: - std::size_t use_count_; + atomic< std::size_t > use_count_; mutable mutex mtx_; mutable condition waiters_; bool ready_;