aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/accept/actor_identity.zc
blob: cf2d4bf6c8d40525e38fc37061c458c2fb22ec58 (plain) (blame)
1
2
3
4
5
6
7
8
9
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;
}