about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-10 13:10:23 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-10 13:10:23 -0800
commit06606073e45a8edb1a76bd35c36ea74eacb69727 (patch)
treeee8a9bfecad61e65d6988f44dba8af5161ba1bc4 /mu.arc.t
parentc23d31cd60be98fd795546c83d5ca0c82029c932 (diff)
downloadmu-06606073e45a8edb1a76bd35c36ea74eacb69727.tar.gz
525 - 'fork' now returns a routine id
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index ab015c42..b9ce4dbe 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2788,6 +2788,36 @@
   (prn "F - fork works"))
 
 (reset)
+(new-trace "fork-returns-id")
+(add-code
+  '((function f1 [
+      (1:integer <- copy 4:literal)
+     ])
+    (function main [
+      (2:integer <- fork f1:fn)
+     ])))
+(run 'main)
+;? (prn memory*)
+(if (no memory*.2)
+  (prn "F - fork returns a pid for the new routine"))
+
+(reset)
+(new-trace "fork-returns-unique-id")
+(add-code
+  '((function f1 [
+      (1:integer <- copy 4:literal)
+     ])
+    (function main [
+      (2:integer <- fork f1:fn)
+      (3:integer <- fork f1:fn)
+     ])))
+(run 'main)
+(if (or (no memory*.2)
+        (no memory*.3)
+        (is memory*.2 memory*.3))
+  (prn "F - fork returns a unique pid everytime"))
+
+(reset)
 (new-trace "fork-with-args")
 (add-code
   '((function f1 [