5#ifndef RUNTIME_VM_THREAD_BARRIER_H_
6#define RUNTIME_VM_THREAD_BARRIER_H_
50 : ref_count_(num_threads),
52 participating_(initial),
58 if (generation_ != 0) {
68 const intptr_t g = generation_;
70 if (remaining_ == 0) {
73 remaining_ = participating_;
77 while (g == generation_) {
84 intptr_t old = ref_count_.fetch_sub(1, std::memory_order_acq_rel);
92 std::atomic<intptr_t> ref_count_;
95 intptr_t participating_;
Monitor::WaitResult Wait(int64_t millis=Monitor::kNoTimeout)
ThreadBarrier(intptr_t num_threads, intptr_t initial=0)