sl@0: // Copyright (C) 2002-2003 sl@0: // David Moore, William E. Kempf sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: #ifndef BOOST_BARRIER_JDM030602_HPP sl@0: #define BOOST_BARRIER_JDM030602_HPP sl@0: sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: sl@0: namespace boost { sl@0: sl@0: class BOOST_THREAD_DECL barrier sl@0: { sl@0: public: sl@0: barrier(unsigned int count); sl@0: ~barrier(); sl@0: sl@0: bool wait(); sl@0: sl@0: private: sl@0: mutex m_mutex; sl@0: // disable warnings about non dll import sl@0: // see: http://www.boost.org/more/separate_compilation.html#dlls sl@0: #ifdef BOOST_MSVC sl@0: # pragma warning(push) sl@0: # pragma warning(disable: 4251 4231 4660 4275) sl@0: #endif sl@0: condition m_cond; sl@0: #ifdef BOOST_MSVC sl@0: # pragma warning(pop) sl@0: #endif sl@0: unsigned int m_threshold; sl@0: unsigned int m_count; sl@0: unsigned int m_generation; sl@0: }; sl@0: sl@0: } // namespace boost sl@0: sl@0: #endif