boost::atomic<bool>
was added in boost v1.53.0, based on c++11 std::atomic
s. For example:
#include <boost/atomic.hpp>
boost::atomic<bool> is_killing (false);
while (!is_killing)
{
}
This would eliminate the explicit mutex
and the safe_access
function from the code, providing the synchronization required.