aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/accept/actor_identity.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads/accept/actor_identity.zc')
-rw-r--r--tests/threads/accept/actor_identity.zc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/threads/accept/actor_identity.zc b/tests/threads/accept/actor_identity.zc
new file mode 100644
index 0000000..cf2d4bf
--- /dev/null
+++ b/tests/threads/accept/actor_identity.zc
@@ -0,0 +1,10 @@
+namespace;
+include rt, actor;
+typecheck on;
+fn main() {
+ let process = rt.syscall(53, 0, 0, 0), thread = rt.syscall(54, 0, 0, 0), result = 0;
+ actor.Actor<int,int>* a = rt.new(actor.Actor<int,int>);
+ a.spawn(fn(int n) { return rt.syscall(53, 0, 0, 0) == process && rt.syscall(54, 0, 0, 0) != thread; });
+ a.recv(fn(int n) { result = n; return 0; }); a.send(1); a.await();
+ rt.put_n(result); rt.put_c(10); a.close(); return 0;
+}