# note: very nondeterministic due to the naps, and output is nondet too.
# gives different output when run with sc than with sw or su
# demonstrates effect of different signal discipline
# (of course, could be just scheduler, though; but it is not.)
# (output from sw and su is the same)
resource main()
    import foo
    process p(i:=1 to 10)
        write( i, "before" )
	var k: int
	nap(10-i)
	if i > 5 -> k := 10-i [] else -> k := i+3; k := 99 /*testing*/  fi
        foo.enter(k)
        write( i, "in" )
        nap(2)
        write( i, "leaves" )
        foo.xexit()
        write( i, "after" )
    end
end
