mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-07 23:10:31 +08:00
Cygwin: implement sem_clockwait
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
d4e7869ee4
commit
edf48054e9
@ -1287,6 +1287,7 @@ secure_getenv NOSIGFE
|
|||||||
seed48 NOSIGFE
|
seed48 NOSIGFE
|
||||||
seekdir SIGFE
|
seekdir SIGFE
|
||||||
select = cygwin_select SIGFE
|
select = cygwin_select SIGFE
|
||||||
|
sem_clockwait SIGFE
|
||||||
sem_close SIGFE
|
sem_close SIGFE
|
||||||
sem_destroy SIGFE
|
sem_destroy SIGFE
|
||||||
sem_getvalue SIGFE
|
sem_getvalue SIGFE
|
||||||
|
@ -32,6 +32,9 @@ extern "C"
|
|||||||
int sem_unlink (const char *__name);
|
int sem_unlink (const char *__name);
|
||||||
int sem_wait (sem_t *__sem);
|
int sem_wait (sem_t *__sem);
|
||||||
int sem_trywait (sem_t *__sem);
|
int sem_trywait (sem_t *__sem);
|
||||||
|
#if __GNU_VISIBLE
|
||||||
|
int sem_clockwait (sem_t *__sem, clockid_t __clock_id, const struct timespec *__abstime);
|
||||||
|
#endif
|
||||||
int sem_timedwait (sem_t *__sem, const struct timespec *__abstime);
|
int sem_timedwait (sem_t *__sem, const struct timespec *__abstime);
|
||||||
int sem_post (sem_t *__sem);
|
int sem_post (sem_t *__sem);
|
||||||
int sem_getvalue (sem_t *__sem, int *__sval);
|
int sem_getvalue (sem_t *__sem, int *__sval);
|
||||||
|
@ -169,10 +169,16 @@ sem_trywait (sem_t * sem)
|
|||||||
return semaphore::trywait (sem);
|
return semaphore::trywait (sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
sem_clockwait (sem_t * sem, clockid_t clock_id, const struct timespec *abstime)
|
||||||
|
{
|
||||||
|
return semaphore::clockwait (sem, clock_id, abstime);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sem_timedwait (sem_t * sem, const struct timespec *abstime)
|
sem_timedwait (sem_t * sem, const struct timespec *abstime)
|
||||||
{
|
{
|
||||||
return semaphore::timedwait (sem, abstime);
|
return semaphore::clockwait (sem, CLOCK_REALTIME, abstime);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -4002,7 +4002,8 @@ semaphore::trywait (sem_t *sem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
semaphore::timedwait (sem_t *sem, const struct timespec *abstime)
|
semaphore::clockwait (sem_t *sem, clockid_t clock_id,
|
||||||
|
const struct timespec *abstime)
|
||||||
{
|
{
|
||||||
LARGE_INTEGER timeout;
|
LARGE_INTEGER timeout;
|
||||||
|
|
||||||
@ -4019,7 +4020,7 @@ semaphore::timedwait (sem_t *sem, const struct timespec *abstime)
|
|||||||
|
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
int err = pthread_convert_abstime (CLOCK_REALTIME, abstime, &timeout);
|
int err = pthread_convert_abstime (clock_id, abstime, &timeout);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -679,7 +679,8 @@ public:
|
|||||||
static int post (sem_t *sem);
|
static int post (sem_t *sem);
|
||||||
static int getvalue (sem_t *sem, int *sval);
|
static int getvalue (sem_t *sem, int *sval);
|
||||||
static int trywait (sem_t *sem);
|
static int trywait (sem_t *sem);
|
||||||
static int timedwait (sem_t *sem, const struct timespec *abstime);
|
static int clockwait (sem_t *sem, clockid_t clock_id,
|
||||||
|
const struct timespec *abstime);
|
||||||
|
|
||||||
static int getinternal (sem_t *sem, int *sfd, unsigned long long *shash,
|
static int getinternal (sem_t *sem, int *sfd, unsigned long long *shash,
|
||||||
LUID *sluid, unsigned int *sval);
|
LUID *sluid, unsigned int *sval);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user