summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/make/pseudo_barrier.h
blob: 5a6b045fda7c10071fb9d750f1d013a50717e800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <atomic>
#include <thread>

typedef std::atomic<int> pseudo_barrier_t;

static inline void pseudo_barrier_wait(pseudo_barrier_t &barrier) {
  --barrier;
  while (barrier > 0)
    std::this_thread::yield();
}

static inline void pseudo_barrier_init(pseudo_barrier_t &barrier, int count) {
  barrier = count;
}
OpenPOWER on IntegriCloud