Add *NSYNC unit test suite

This change also fixes the clock_nanosleep() api and polyfills futexes
on Windows, Mac, and NetBSD using exponential backoff.
This commit is contained in:
Justine Tunney 2022-10-07 21:29:40 -07:00
parent 3421b9a580
commit 9849b4c7ba
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
51 changed files with 5505 additions and 1060 deletions

19
third_party/nsync/testing/time_extra.h vendored Normal file
View file

@ -0,0 +1,19 @@
#ifndef NSYNC_TESTING_TIME_EXTRA_H_
#define NSYNC_TESTING_TIME_EXTRA_H_
#include "third_party/nsync/time.h"
/* Return a malloced nul-terminated string representing time t, using
"decimals" decimal places. */
char *nsync_time_str(nsync_time t, int decimals);
/* Sleep until the specified time. Returns 0 on success, and EINTR
if the call was interrupted. */
int nsync_time_sleep_until(nsync_time abs_deadline);
/* Return t as a double. */
double nsync_time_to_dbl(nsync_time t);
/* Return a time corresponding to double d. */
nsync_time nsync_time_from_dbl(double d);
#endif /*NSYNC_TESTING_TIME_EXTRA_H_*/