% $Id: Barrier.oz,v 1.1 2007/11/14 02:26:11 leavens Exp leavens $ declare % Figure 4.22 of CTM proc {Barrier Ps} fun {BarrierLoop Ps L} case Ps of P|Pr then M in thread {P} M=L end {BarrierLoop Pr M} [] nil then L end end S={BarrierLoop Ps unit} in {Wait S} end