From bc87dc34152284df3c483ed0eb5388cc6a66920a Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 29 Dec 2013 11:32:25 +0100 Subject: [PATCH] use atomics for intrusive_ptr of shared_state --- include/boost/fiber/future/detail/shared_state.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/fiber/future/detail/shared_state.hpp b/include/boost/fiber/future/detail/shared_state.hpp index 790ee89d..c0dccea1 100644 --- a/include/boost/fiber/future/detail/shared_state.hpp +++ b/include/boost/fiber/future/detail/shared_state.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -36,7 +37,7 @@ template< typename R > class shared_state : public noncopyable { private: - std::size_t use_count_; + atomic< std::size_t > use_count_; mutable mutex mtx_; mutable condition waiters_; bool ready_;