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