resource main()
    import cscan
    process p(i:=1 to 10)
        write( i, "before" )
	var k: int
     fa h := 1 to 2 ->
	nap(10-i)
	if i > 5 -> k := 10+i [] i = 5 -> k := 12 [] else -> k := 10-i  fi
        cscan.request(k)
        write( i, "got it" )
        nap(20)
        write( i, "done" )
        cscan.release()
        write( i, "after" )
    af
    end
end
