aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/accept/cancel_o3.zc
blob: e196a13489bddcfec8a14af4b44aaaf564fc42e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
namespace;
include rt;
o3 int spin() { int n = 0; while (1) n++; return n; }
unchecked fn main() {
 int fd = 0;
 let context = rt.syscall(51, fn() { return spin(); } as word, &fd, 0);
 rt.syscall(48, 20, 0, 0); let started = rt.syscall(50, 0, 0, 0);
 rt.put_n(rt.syscall(52, context, 1, 0)); rt.put_c(10); rt.put_n(rt.syscall(50, 0, 0, 0) - started); rt.put_c(10); return 0;
}