var a, b, thread1, thread2 in a := 0; thread1 := (param) => { tStart(thread2, 0); output "After thread2 start"; output a; b := 0; while (b < 5000) { b := b + 1 }; output "After inner loop"; output a }; thread2 := (param) => { while (a < 5000) { a := a + 1 } }; atomic { tStart(thread1, 0) }; output "Final output"; output a