Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libc-bottom-half/sources/__wasilibc_futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ int __wasilibc_futex_wait_wasix(volatile void *addr, int op, int expected, int64
__wasi_bool_t woken = __WASI_BOOL_FALSE;

__wasi_option_timestamp_t timeout;
if (max_wait_ns > 0) {
if (max_wait_ns >= 0) {
timeout.tag = __WASI_OPTION_SOME;
timeout.u.none = max_wait_ns;
timeout.u.some = max_wait_ns;
} else {
timeout.tag = __WASI_OPTION_NONE;
timeout.u.none = 0;
Expand Down
6 changes: 0 additions & 6 deletions libc-top-half/musl/src/thread/__timedwait.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,13 @@ int __timedwait_cp(volatile int *addr, int val,
top = &to;
}

#ifdef __wasilibc_unmodified_upstream
r = -__futex4_cp(addr, FUTEX_WAIT|priv, val, top);
if (r != EINTR && r != ETIMEDOUT && r != ECANCELED) r = 0;
/* Mitigate bug in old kernels wrongly reporting EINTR for non-
* interrupting (SA_RESTART) signal handlers. This is only practical
* when NO interrupting signal handlers have been installed, and
* works by sigaction tracking whether that's the case. */
if (r == EINTR && !__eintr_valid_flag) r = 0;
#else
volatile int waiters = 0;
__wait(addr, &waiters, val, 0);
r = 0;
#endif

return r;
}
Expand Down