x := 0 || proc A { loop { if x = 0 then { [A enter critical section]; [A exit critical section]; x := 1 } } } || proc B { loop { if x = 1 then { [B enter critical section]; [B exit critical section]; x := 0 } else [B wait] } }