aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/accept/cancel_o3.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads/accept/cancel_o3.zc')
-rw-r--r--tests/threads/accept/cancel_o3.zc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/threads/accept/cancel_o3.zc b/tests/threads/accept/cancel_o3.zc
new file mode 100644
index 0000000..e196a13
--- /dev/null
+++ b/tests/threads/accept/cancel_o3.zc
@@ -0,0 +1,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;
+}