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_;