mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: workaround linking on macos (missing sem_timedwait)
This commit is contained in:
parent
9e2607db57
commit
97eb0fc74f
@ -175,10 +175,16 @@ pub fn (mut sem Semaphore) try_wait() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn (mut sem Semaphore) timed_wait(timeout time.Duration) bool {
|
pub fn (mut sem Semaphore) timed_wait(timeout time.Duration) bool {
|
||||||
|
$if macos {
|
||||||
|
time.sleep(timeout)
|
||||||
|
return true
|
||||||
|
}
|
||||||
t_spec := timeout.timespec()
|
t_spec := timeout.timespec()
|
||||||
for {
|
for {
|
||||||
if C.sem_timedwait(&sem.sem, &t_spec) == 0 {
|
$if !macos {
|
||||||
return true
|
if C.sem_timedwait(&sem.sem, &t_spec) == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e := C.errno
|
e := C.errno
|
||||||
match e {
|
match e {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user