tests/posix_semaphore: sem_timedwait should not return before abstime
Update the test as sem_timedwait is not supposed to return before the given abstime. Source: http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/functions/sem_timedwait.html The timeout shall expire when the absolute time specified by abstime passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abstime), or if the absolute time specified by abstime has already been passed at the time of the call.
This commit is contained in:
parent
3aec0c77ee
commit
732bcc7335
@ -279,7 +279,7 @@ void test4(void)
|
||||
}
|
||||
|
||||
uint64_str[fmt_u64_dec(uint64_str, elapsed)] = '\0';
|
||||
if (elapsed < (exp - 100)) {
|
||||
if (elapsed < exp) {
|
||||
printf("first: waited only %s usec => FAILED\n", uint64_str);
|
||||
}
|
||||
else if (elapsed > (exp + TEST4_TIMEOUT_EXCEEDED_MARGIN)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user