13 /* Startup object is generated with the initialstate flag set by the
14 * system to start the computation up */
16 task Startup(StartupObject s {initialstate}) {
17 for(int i=0;i<10;i++) {
18 Example e=new Example() {needoperation};
24 taskexit(s {!initialstate}); /* Turns initial state flag off, so this task won't refire */
29 task DoOperation(Example e{needoperation}) {
33 /* Print the result */
34 taskexit(e {!needoperation, needprinting}) assert (Example(e : e));
36 /* Don't print the result */
37 taskexit(e {!needoperation}) assert (Example(e : e));
40 /* Note that we can write arbitrary boolean expressions for flag
41 * expressions. For example, needprinting && ! needoperation would
42 * also be a legal flag expression */
44 task DoPrint(Example e{needprinting}) {
46 System.printString("\n");
47 taskexit(e {!needprinting});