mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38:30 +00:00
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:
parent
3421b9a580
commit
9849b4c7ba
51 changed files with 5505 additions and 1060 deletions
19
third_party/nsync/testing/time_extra.h
vendored
Normal file
19
third_party/nsync/testing/time_extra.h
vendored
Normal 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_*/
|
Loading…
Add table
Add a link
Reference in a new issue