mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 11:12:27 +00:00
Support process shared condition variables
This commit is contained in:
parent
3de6632be6
commit
0a9a6f86bb
14 changed files with 168 additions and 19 deletions
|
@ -81,13 +81,15 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime) {
|
|||
return ecanceled();
|
||||
}
|
||||
rc = _sysret(__syslib->__sem_trywait(sem->sem_kernel));
|
||||
if (!rc) return 0;
|
||||
if (!rc)
|
||||
return 0;
|
||||
if (errno == EINTR && //
|
||||
_weaken(pthread_testcancel_np) && //
|
||||
_weaken(pthread_testcancel_np)()) {
|
||||
return ecanceled();
|
||||
}
|
||||
if (errno != EAGAIN) return -1;
|
||||
if (errno != EAGAIN)
|
||||
return -1;
|
||||
errno = e;
|
||||
struct timespec now = timespec_real();
|
||||
if (timespec_cmp(*abstime, now) >= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue