Lines Matching refs:Barrier
17 #include "barrier.h"
30 CheckWaitTask(Barrier* barrier, AtomicInteger* count1, AtomicInteger* count2,
32 : barrier_(barrier),
38 LOG(INFO) << "Before barrier 1 " << *self;
42 LOG(INFO) << "Before barrier 2 " << *self;
45 LOG(INFO) << "After barrier 2 " << *self;
53 Barrier* const barrier_;
66 // Check that barrier wait and barrier increment work.
70 Barrier barrier(0);
75 thread_pool.AddTask(self, new CheckWaitTask(&barrier, &count1, &count2, &count3));
78 barrier.Increment(self, num_threads);
79 // At this point each thread should have passed through the barrier. The first count should be
82 // Count 3 should still be zero since no thread should have gone past the second barrier.
85 barrier.Increment(self, num_threads);
86 // Count 2 should be equal to num_threads since each thread must have passed the second barrier
99 CheckPassTask(Barrier* barrier, AtomicInteger* count, size_t subtasks)
100 : barrier_(barrier),
116 Barrier* const barrier_;
121 // Check that barrier pass through works.
125 Barrier barrier(0);
130 thread_pool.AddTask(self, new CheckPassTask(&barrier, &count, num_sub_tasks));
134 // Wait for all the tasks to complete using the barrier.
135 barrier.Increment(self, expected_total_tasks);