3 // Note that although hogging the CPU while waiting for a variable to change
4 // would be terrible in production code, it's great for testing since it avoids
5 // a lot of messy context switching to get multiple threads synchronized.
7 typedef std::atomic
<int> pseudo_barrier_t
;
9 #define pseudo_barrier_wait(barrier) \
13 while ((barrier).load() > 0) \
17 #define pseudo_barrier_init(barrier, count) \
20 (barrier) = (count); \