shared can_a_continue := semaphore(0)
shared can_b_continue := semaphore(0)
main:
create_thread(thread_a, 1)
create_thread(thread_b, 1)
thread_a:
statement a1
signal(can_b_continue);
wait(can_a_continue);
statement a2
thread_b:
statement b1
signal(can_a_continue);
wait(can_b_continue);
statement b2