summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sys/sys+freebsd-x64.myr2
-rw-r--r--lib/thread/bld.sub3
-rw-r--r--lib/thread/mutex+freebsd.myr1
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/sys/sys+freebsd-x64.myr b/lib/sys/sys+freebsd-x64.myr
index fbac582..1362282 100644
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -863,6 +863,7 @@ pkg sys =
const clock_gettime : (clk : clock, ts : timespec# -> int32)
const clock_settime : (clk : clock, ts : timespec# -> int32)
const nanosleep : (req : timespec#, rem : timespec# -> int32)
+ const sched_yield : (-> void)
/* system information */
const uname : (buf : utsname# -> int)
@@ -991,6 +992,7 @@ const clock_getres = {clk, ts; -> syscall(Sysclock_getres, clockid(clk), a(ts))
const clock_gettime = {clk, ts; -> syscall(Sysclock_gettime, clockid(clk), a(ts)) castto(int32)}
const clock_settime = {clk, ts; -> syscall(Sysclock_settime, clockid(clk), a(ts)) castto(int32)}
const nanosleep = {req, rem; -> syscall(Sysnanosleep, a(req), a(rem)) castto(int32)}
+const sched_yield = {; syscall(Syssched_yield)}
/* system information */
diff --git a/lib/thread/bld.sub b/lib/thread/bld.sub
index 73a07cc..378e17f 100644
--- a/lib/thread/bld.sub
+++ b/lib/thread/bld.sub
@@ -27,5 +27,8 @@ lib thread =
atomic-impl+x64.s
atomic.myr
+
+ lib ../sys:sys
+ lib ../std:std
;;
diff --git a/lib/thread/mutex+freebsd.myr b/lib/thread/mutex+freebsd.myr
index 8e4c10d..7ae2b15 100644
--- a/lib/thread/mutex+freebsd.myr
+++ b/lib/thread/mutex+freebsd.myr
@@ -37,6 +37,7 @@ const mtxlock = {mtx
if c == Unlocked
-> void
;;
+ sys.sched_yield()
;;
/*