about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-18 11:33:28 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-18 11:33:28 -0700
commit5a820205054a9c45a9b4dc71aa1f26b4612ec76d (patch)
treed852403773c3f0643ee983a479acf35eeeb44da8
parent5813bcfc7d5c368514554d712da45584b5114f0b (diff)
downloadmu-5a820205054a9c45a9b4dc71aa1f26b4612ec76d.tar.gz
3521
-rw-r--r--073wait.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/073wait.cc b/073wait.cc
index 122f4731..4105d506 100644
--- a/073wait.cc
+++ b/073wait.cc
@@ -386,8 +386,21 @@ case SWITCH: {
   goto stop_running_current_routine;
 }
 
-//:(scenario switch_preempts_current_routine)
-
+:(scenario switch_preempts_current_routine)
+def f1 [
+  start-running f2
+  1:num <- copy 34
+  switch
+  3:num <- copy 36
+]
+def f2 [
+  2:num <- copy 35
+]
++mem: storing 34 in location 1
+# context switch
++mem: storing 35 in location 2
+# back to original thread
++mem: storing 36 in location 3
 
 //:: helpers for manipulating routines in tests
 //: