author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (C) 2002-2003 |
sl@0 | 2 |
// David Moore, William E. Kempf |
sl@0 | 3 |
// |
sl@0 | 4 |
// Distributed under the Boost Software License, Version 1.0. (See accompanying |
sl@0 | 5 |
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
sl@0 | 6 |
|
sl@0 | 7 |
#ifndef BOOST_BARRIER_JDM030602_HPP |
sl@0 | 8 |
#define BOOST_BARRIER_JDM030602_HPP |
sl@0 | 9 |
|
sl@0 | 10 |
#include <boost/thread/detail/config.hpp> |
sl@0 | 11 |
|
sl@0 | 12 |
#include <boost/thread/mutex.hpp> |
sl@0 | 13 |
#include <boost/thread/condition.hpp> |
sl@0 | 14 |
|
sl@0 | 15 |
namespace boost { |
sl@0 | 16 |
|
sl@0 | 17 |
class BOOST_THREAD_DECL barrier |
sl@0 | 18 |
{ |
sl@0 | 19 |
public: |
sl@0 | 20 |
barrier(unsigned int count); |
sl@0 | 21 |
~barrier(); |
sl@0 | 22 |
|
sl@0 | 23 |
bool wait(); |
sl@0 | 24 |
|
sl@0 | 25 |
private: |
sl@0 | 26 |
mutex m_mutex; |
sl@0 | 27 |
// disable warnings about non dll import |
sl@0 | 28 |
// see: http://www.boost.org/more/separate_compilation.html#dlls |
sl@0 | 29 |
#ifdef BOOST_MSVC |
sl@0 | 30 |
# pragma warning(push) |
sl@0 | 31 |
# pragma warning(disable: 4251 4231 4660 4275) |
sl@0 | 32 |
#endif |
sl@0 | 33 |
condition m_cond; |
sl@0 | 34 |
#ifdef BOOST_MSVC |
sl@0 | 35 |
# pragma warning(pop) |
sl@0 | 36 |
#endif |
sl@0 | 37 |
unsigned int m_threshold; |
sl@0 | 38 |
unsigned int m_count; |
sl@0 | 39 |
unsigned int m_generation; |
sl@0 | 40 |
}; |
sl@0 | 41 |
|
sl@0 | 42 |
} // namespace boost |
sl@0 | 43 |
|
sl@0 | 44 |
#endif |