3 #include <cds/gc/dhp.h>
5 #include <cds/misc/barrier.h>
6 #include <cds_test/stress_test.h>
15 typedef cds_others::SpinBarrier Barrier;
17 static size_t s_nBarrierThreadCount = 2;
18 static size_t s_nBarrierPassCount = 1;
20 class BarrierTest : public cds_test::stress_fixture {
24 static void SetUpTestCase() {
25 cds_test::config const &cfg = get_config("SequentialMisc");
26 GetConfig(BarrierPassCount);
27 GetConfig(BarrierThreadCount);
31 size_t BarrierTest::count;
33 TEST_F(BarrierTest, Wait) {
34 std::unique_ptr<Barrier> barrier(new Barrier(1));
35 for (size_t i = 0; i < s_nBarrierPassCount; i++) {
36 if (barrier->wait()) {
40 EXPECT_EQ(count, s_nBarrierPassCount);