# some tricky scheduling stuff
# simplified from a bug report

resource Jacobi()
   op terminate (int n)
   const int blksize = 4
   const int nloops = 5

   process sender [ i = 1 to blksize ] {
     for [ h = 1 to nloops ] {
	 call terminate(i)
     }
   }

   process coordinator  {
      while (true) {
	 in terminate(delta) st ?terminate == blksize by -delta ->
	    write ("begin inner loop; ?terminate =", ?terminate)
	    write("  delta =",delta)

	     for [ i = 2 to blksize ] {
	       in terminate(delta) ->
		  write("  delta =",delta)
	       ni
	     }

	 ni
      }
   }

end Jacobi
