1*791b6ebcSPavel Labath #include "pseudo_barrier.h" 2*791b6ebcSPavel Labath #include <thread> 3*791b6ebcSPavel Labath 4*791b6ebcSPavel Labath 5*791b6ebcSPavel Labath pseudo_barrier_t barrier_before; 6*791b6ebcSPavel Labath pseudo_barrier_t barrier_after; 7*791b6ebcSPavel Labath break_here()8*791b6ebcSPavel Labathvoid break_here() {} 9*791b6ebcSPavel Labath thread_func()10*791b6ebcSPavel Labathvoid thread_func() { 11*791b6ebcSPavel Labath pseudo_barrier_wait(barrier_before); 12*791b6ebcSPavel Labath break_here(); 13*791b6ebcSPavel Labath pseudo_barrier_wait(barrier_after); 14*791b6ebcSPavel Labath } 15*791b6ebcSPavel Labath main()16*791b6ebcSPavel Labathint main() { 17*791b6ebcSPavel Labath pseudo_barrier_init(barrier_before, 2); 18*791b6ebcSPavel Labath pseudo_barrier_init(barrier_after, 2); 19*791b6ebcSPavel Labath std::thread thread(thread_func); 20*791b6ebcSPavel Labath pseudo_barrier_wait(barrier_before); 21*791b6ebcSPavel Labath pseudo_barrier_wait(barrier_after); 22*791b6ebcSPavel Labath thread.join(); 23*791b6ebcSPavel Labath return 0; 24*791b6ebcSPavel Labath } 25