Support process shared condition variables

This commit is contained in:
Justine Tunney 2024-07-22 16:33:23 -07:00
parent 3de6632be6
commit 0a9a6f86bb
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
14 changed files with 168 additions and 19 deletions

View file

@ -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) {