1
// (C) Copyright 2013 Vicente J. Botet Escriba
3
// Distributed under the Boost Software License, Version 1.0. (See accompanying
4
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
#define BOOST_THREAD_PROVIDES_INTERRUPTIONS
8
#include <boost/thread/detail/config.hpp>
10
#include <boost/thread/thread.hpp>
11
#include <boost/thread/barrier.hpp>
13
#include <boost/detail/lightweight_test.hpp>
19
// Shared variables for generation barrier test
20
long global_parameter;
26
const int N_THREADS=3;
27
boost::barrier gen_barrier(N_THREADS, void_fct);
31
for (int i = 0; i < 5; ++i)
33
gen_barrier.count_down_and_wait();
41
boost::thread_group g;
46
for (int i = 0; i < N_THREADS; ++i)
47
g.create_thread(&barrier_thread);
57
BOOST_TEST(global_parameter==5);
65
return boost::report_errors();