thread {Delay 1} {Show 111} end {Show 222} %----------------- declare proc {Test A N} {Browse [A N]} if N>0 then {Test A N-1} %{Delay 1} end end thread {Test a 5} end {Test b 5} %---------------------- declare X0 X1 X2 X3 thread X1=1+X0 end thread X3=X1+X2 end {Browse [X0 X1 X2 X3]} X0=4 X2=7 %------------------ declare fun {MyDelay} {Delay 10} 0 end fun {CTest} C={NewCell 0} L={NewLock} Idone Jdone in thread % lock L then C:= @C + {MyDelay} + 1 Idone=true % end end thread % lock L then C:= @C + {MyDelay} + 1 Jdone=true % end end {Wait Idone}{Wait Jdone} @C end for X in 1..10 do Res = {CTest} in {Show [' Result is ' Res]} end {Show done}