aboutsummaryrefslogtreecommitdiff
path: root/tests/actor/accept/safepoint.zc
blob: 23c8ecaed20e6ac8b91a2641333a7a5499f6be65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
namespace;
include rt, actor;
typecheck on;
int handle(int n) { return n * 2; }
fn main() {
 actor.Actor<int,int>* a = rt.new(actor.Actor<int,int>);
 let result = 0; a.spawn(handle); a.recv(fn(int n) { result = n; return 0; });
 a.send(4); rt.syscall(48, 50, 0, 0);
 rt.put_n(result); rt.put_c(10); a.close(); return 0;
}