ref: c3e6c525d4716fdaa8839119f4d487f76401f272
parent: 5c2890a66e673f159329ce55790ee6b05ebf1041
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jan 6 19:51:43 EST 2016
Add yield system call This makes our spinlock more efficient.
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -705,6 +705,7 @@
const thr_new : (param : thrparam#, paramsz : int -> int)
const thr_exit : (state : int64# -> void)
const umtx_op : (obj : void#, op : umtxop, val : uint64, a1 : void#, a2 : void# -> int)
+ const yield : (-> int)
/* fd manipulation */
const open : (path:byte[:], opts:fdopt -> fd)
@@ -826,6 +827,7 @@
const thr_new = {param, sz; -> syscall(Systhr_new, a(param), a(sz)) castto(int)}
const thr_exit = {state; syscall(Systhr_exit, a(state))}
const umtx_op = {obj, op, val, a1, a2; -> syscall(Sys_umtx_op, a(obj), a(op), a(val), a(a1), a(a2)) castto(int)}
+const yield = {; -> syscall(Sysyield) castto(int)}
/* fd manipulation */
const open = {path, opts; -> syscall(Sysopen, cstring(path), a(opts), a(0o777)) castto(fd)}