summaryrefslogtreecommitdiff
path: root/Chalice/tests/examples/BackgroundComputation.chalice
diff options
context:
space:
mode:
Diffstat (limited to 'Chalice/tests/examples/BackgroundComputation.chalice')
-rw-r--r--Chalice/tests/examples/BackgroundComputation.chalice38
1 files changed, 0 insertions, 38 deletions
diff --git a/Chalice/tests/examples/BackgroundComputation.chalice b/Chalice/tests/examples/BackgroundComputation.chalice
deleted file mode 100644
index e8168183..00000000
--- a/Chalice/tests/examples/BackgroundComputation.chalice
+++ /dev/null
@@ -1,38 +0,0 @@
-class C {
- var x: int;
-
- method main()
- requires acc(x);
- ensures acc(x);
- {
- // start long-running processing
- fork tk := processing();
-
- /* do some computation itself */
-
- // finish
- call finish(tk);
- }
-
- method finish(tk: token<C.processing>)
- requires acc(x,100-rd(tk));
- requires acc(tk.joinable) && tk.joinable && tk != null;
- requires eval(tk.fork this.processing(), true);
- ensures acc(x);
- {
- var res: int;
- join res := tk;
-
- // final write to x (requires full permission)
- this.x := res - 1;
- }
-
- method processing() returns (res: int)
- requires rd(x);
- ensures rd(x);
- {
- res := 1;
- /* do some computation */
- }
-
-}