Ticket #6230: 6230_barrier.diff
File 6230_barrier.diff, 1.1 KB (added by , 11 years ago) |
---|
-
boost/thread/barrier.hpp
2 2 // David Moore, William E. Kempf 3 3 // Copyright (C) 2007-8 Anthony Williams 4 4 // 5 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 7 8 8 #ifndef BOOST_BARRIER_JDM030602_HPP … … 28 28 : m_threshold(count), m_count(count), m_generation(0) 29 29 { 30 30 if (count == 0) 31 boost::throw_exception( std::invalid_argument("count cannot be zero."));31 boost::throw_exception(thread_exception(system::errc::invalid_argument, "barrier constructor: count cannot be zero.")); 32 32 } 33 33 34 34 bool wait() 35 35 { 36 36 boost::mutex::scoped_lock lock(m_mutex); 37 37 unsigned int gen = m_generation; 38 38 39 39 if (--m_count == 0) 40 40 { 41 41 m_generation++;