On 11/17/21 06:50, Zebediah Figura wrote:
while (!InterlockedExchange( futex, 0 ))
{
if (timeout)
{
LONGLONG timeleft = update_timeout( end );
struct timespec timespec;
timespec.tv_sec = timeleft / (ULONGLONG)TICKSPERSEC;
timespec.tv_nsec = (timeleft % TICKSPERSEC) * 100;
ret = futex_wait( futex, 0, ×pec );
}
else
ret = futex_wait( futex, 0, NULL );
if (ret == -1 && errno == ETIMEDOUT) return STATUS_TIMEOUT;
}
return STATUS_ALERTED;
- }
+#endif
Do you think it is possible or makes sense to handle EINTR and retry wait to avoid delivering spurious wakeups to the application in this case? We have a lot of SIGUSR1 for Wine async I/O handling. Also, maybe it would be interesting to log unexpected errors? Not that anything besides EINTR should ever happen as I understand, but sometimes unexpected errors happen and may indicate a real issue and that happened once in the past with the current upstream in process sync.