[PATCH v2 4/4] c2y: Add function cnd_timedwait_base and mtx_timedlock_base
Joseph Myers
joseph@codesourcery.com
Tue Jun 20 20:41:02 GMT 2023
On Wed, 21 Jun 2023, Yonggang Luo via Libc-alpha wrote:
> diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h
> index d88d7a3ddd..4f61ad9236 100644
> --- a/sysdeps/pthread/threads.h
> +++ b/sysdeps/pthread/threads.h
> @@ -146,14 +146,22 @@ extern int mtx_lock (mtx_t *__mutex);
> #ifndef __USE_TIME_BITS64
> extern int mtx_timedlock (mtx_t *__restrict __mutex,
> const struct timespec *__restrict __time_point);
> +extern int mtx_timedlock_base (mtx_t *__restrict __mutex, int time_base,
> + const struct timespec *__restrict __time_point);
As noted, this should be conditional on __USE_GNU. Since you didn't make
it conditional, I'd expect it to have failed the conform/ namespace tests
- both for the mtx_timedlock_base name itself if there weren't incorrect
conform/ changes in the patch series, and for the time_base parameter
(parameters in installed headers should always have a leading __). How
did you test these patches?
> +extern int __REDIRECT (mtx_timedlock_base, (mtx_t *__restrict __mutex,
> + int time_base,
> + const struct timespec *__restrict
> + __time_point),
> + __mtx_timedlock_base64);
Likewise, should be conditional on __USE_GNU and time_base should be
__time_base.
> +extern int cnd_timedwait_base (cnd_t *__restrict __cond,
> + mtx_t *__restrict __mutex, int time_base,
> + const struct timespec *__restrict __time_point);
> +extern int __REDIRECT (cnd_timedwait_base, (cnd_t *__restrict __cond,
> + mtx_t *__restrict __mutex,
> + int time_base,
> + const struct timespec *__restrict
> + __time_point),
Likewise.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list