diff options
author | vangyzen <vangyzen@FreeBSD.org> | 2017-03-14 17:52:43 +0000 |
---|---|---|
committer | vangyzen <vangyzen@FreeBSD.org> | 2017-03-14 17:52:43 +0000 |
commit | 72aa1fdeceef03818eb7b197915d42ca76873919 (patch) | |
tree | d9d7b7537c9253168899b020c5c974ba352aa542 /include/semaphore.h | |
parent | 32ef1c0934519221b6371ba801fb798f33c6c9f8 (diff) | |
download | FreeBSD-src-72aa1fdeceef03818eb7b197915d42ca76873919.zip FreeBSD-src-72aa1fdeceef03818eb7b197915d42ca76873919.tar.gz |
MFC r314179 r314206 r314424
Add sem_clockwait_np()
This function allows the caller to specify the reference clock
and choose between absolute and relative mode. In relative mode,
the remaining time can be returned.
The API is similar to clock_nanosleep(3). Thanks to Ed Schouten
for that suggestion.
While I'm here, reduce the sleep time in the semaphore "child"
test to greatly reduce its runtime. Also add a reasonable timeout.
Relnotes: yes
Sponsored by: Dell EMC
Diffstat (limited to 'include/semaphore.h')
-rw-r--r-- | include/semaphore.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/semaphore.h b/include/semaphore.h index c42a8d2..110f7c8 100644 --- a/include/semaphore.h +++ b/include/semaphore.h @@ -52,6 +52,10 @@ typedef struct _sem sem_t; struct timespec; __BEGIN_DECLS +#if __BSD_VISIBLE +int sem_clockwait_np(sem_t * __restrict, __clockid_t, int, + const struct timespec *, struct timespec *); +#endif int sem_close(sem_t *); int sem_destroy(sem_t *); int sem_getvalue(sem_t * __restrict, int * __restrict); |