[v2,3/4] c11: Switch to use pthread_mutex_clocklock and pthread_cond_clockwait to implement cnd and mtx lock and wait
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
fail
|
Testing failed
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
fail
|
Testing failed
|
Commit Message
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
sysdeps/pthread/cnd_timedwait.c | 8 ++++----
sysdeps/pthread/mtx_timedlock.c | 6 +++---
sysdeps/unix/sysv/linux/cnd_timedwait.c | 4 ++--
sysdeps/unix/sysv/linux/mtx_timedlock.c | 4 ++--
4 files changed, 11 insertions(+), 11 deletions(-)
@@ -20,10 +20,10 @@
int
cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
- const struct timespec* restrict time_point)
+ const struct timespec *restrict time_point)
{
- int err_code = __pthread_cond_timedwait ((pthread_cond_t *) cond,
- (pthread_mutex_t *) mutex,
- time_point);
+ int err_code = __pthread_cond_clockwait ((pthread_cond_t *) cond,
+ (pthread_mutex_t *) mutex,
+ CLOCK_REALTIME, time_point);
return thrd_err_map (err_code);
}
@@ -20,9 +20,9 @@
int
mtx_timedlock (mtx_t *restrict mutex,
- const struct timespec *restrict time_point)
+ const struct timespec *restrict time_point)
{
- int err_code = __pthread_mutex_timedlock ((pthread_mutex_t *)mutex,
- time_point);
+ int err_code = __pthread_mutex_clocklock ((pthread_mutex_t *) mutex,
+ CLOCK_REALTIME, time_point);
return thrd_err_map (err_code);
}
@@ -24,9 +24,9 @@ int
__cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex,
const struct __timespec64 *restrict time_point)
{
- int err_code = __pthread_cond_timedwait64 ((pthread_cond_t *) cond,
+ int err_code = __pthread_cond_clockwait64 ((pthread_cond_t *) cond,
(pthread_mutex_t *) mutex,
- time_point);
+ CLOCK_REALTIME, time_point);
return thrd_err_map (err_code);
}
@@ -24,8 +24,8 @@ int
__mtx_timedlock64 (mtx_t *restrict mutex,
const struct __timespec64 *restrict time_point)
{
- int err_code = __pthread_mutex_timedlock64 ((pthread_mutex_t *)mutex,
- time_point);
+ int err_code = __pthread_mutex_clocklock64 ((pthread_mutex_t *) mutex,
+ CLOCK_REALTIME, time_point);
return thrd_err_map (err_code);
}