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 */
30 task DoOperation(Example e{needoperation}) {
34 /* Print the result */
35 taskexit(e {!needoperation, needprinting});
37 /* Don't print the result */
38 taskexit(e {!needoperation});
41 /* Note that we can write arbitrary boolean expressions for flag
42 * expressions. For example, needprinting && ! needoperation would
43 * also be a legal flag expression */
45 task DoPrint(Example e{needprinting}) {
47 System.printString("\n");
48 taskexit(e {!needprinting});