diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:50 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-04-21 19:49:50 +0200 |
| commit | f03b78fae46905a5676c7b7f360cadba2f290708 (patch) | |
| tree | 322292da3aeeb1b8e5504afaf089d8a486228303 | |
| parent | 2208066603a136f95cfb815ca9281262e6465784 (diff) | |
| download | glibc-f03b78fae46905a5676c7b7f360cadba2f290708.tar.xz glibc-f03b78fae46905a5676c7b7f360cadba2f290708.zip | |
nptl: Move pthread_mutex_consistent into libc
And deprecated pthread_mutex_consistent_np, its old name.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
69 files changed, 135 insertions, 72 deletions
@@ -20,7 +20,9 @@ Major new features: Deprecated and removed features, and other changes affecting compatibility: - [Add deprecations, removals and changes affecting compatibility here] +* The function pthread_mutex_consistent_np has been deprecated; programs + should use the equivalent standard function pthread_mutex_consistent + instead. Changes to build and runtime requirements: diff --git a/nptl/Makefile b/nptl/Makefile index e665d37e52..6ac96ba1ca 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -72,6 +72,7 @@ routines = \ pthread_getattr_np \ pthread_getschedparam \ pthread_kill \ + pthread_mutex_consistent \ pthread_self \ pthread_setschedparam \ pthread_sigmask \ @@ -142,7 +143,6 @@ libpthread-routines = \ pthread_kill_other_threads \ pthread_mutex_cond_lock \ pthread_mutex_conf \ - pthread_mutex_consistent \ pthread_mutex_destroy \ pthread_mutex_getprioceiling \ pthread_mutex_init \ diff --git a/nptl/Versions b/nptl/Versions index 494fb3efd9..ce9b0e6232 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -56,6 +56,12 @@ libc { GLIBC_2.3.4 { pthread_attr_setaffinity_np; } + GLIBC_2.4 { + pthread_mutex_consistent_np; + } + GLIBC_2.12 { + pthread_mutex_consistent; + } # C11 thread symbols. GLIBC_2.28 { thrd_current; @@ -73,6 +79,7 @@ libc { } GLIBC_2.34 { pthread_kill; + pthread_mutex_consistent; } GLIBC_PRIVATE { __futex_abstimed_wait64; @@ -283,7 +290,6 @@ libpthread { } GLIBC_2.4 { - pthread_mutex_consistent_np; pthread_mutex_getprioceiling; pthread_mutex_setprioceiling; pthread_mutexattr_getprioceiling; @@ -300,7 +306,6 @@ libpthread { GLIBC_2.12 { pthread_getname_np; - pthread_mutex_consistent; pthread_mutexattr_getrobust; pthread_mutexattr_setrobust; pthread_setname_np; diff --git a/nptl/pthread_mutex_consistent.c b/nptl/pthread_mutex_consistent.c index 937c7c4640..df4ba0019d 100644 --- a/nptl/pthread_mutex_consistent.c +++ b/nptl/pthread_mutex_consistent.c @@ -18,10 +18,10 @@ #include <errno.h> #include <pthreadP.h> - +#include <shlib-compat.h> int -pthread_mutex_consistent (pthread_mutex_t *mutex) +__pthread_mutex_consistent (pthread_mutex_t *mutex) { /* Test whether this is a robust mutex with a dead owner. See concurrency notes regarding __kind in struct __pthread_mutex_s @@ -35,4 +35,16 @@ pthread_mutex_consistent (pthread_mutex_t *mutex) return 0; } -weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np) +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent, + GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_4, GLIBC_2_34) +# undef pthread_mutex_consistent_np +compat_symbol (libpthread, __pthread_mutex_consistent, + pthread_mutex_consistent_np, GLIBC_2_4); +#endif + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_34) +compat_symbol (libpthread, __pthread_mutex_consistent, + pthread_mutex_consistent, GLIBC_2_12); +#endif diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index a04a3a2754..23bcd51d91 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -809,8 +809,14 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # ifdef __USE_GNU -extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) - __THROW __nonnull ((1)); +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *), + pthread_mutex_consistent) __nonnull ((1)) + __attribute_deprecated_msg__ ("\ +pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent"); +# else +# define pthread_mutex_consistent_np pthread_mutex_consistent +# endif # endif #endif diff --git a/sysdeps/pthread/tst-robust1.c b/sysdeps/pthread/tst-robust1.c index d4b1d88a68..6342fcbbf7 100644 --- a/sysdeps/pthread/tst-robust1.c +++ b/sysdeps/pthread/tst-robust1.c @@ -241,14 +241,14 @@ do_test (void) #endif #ifndef NOT_CONSISTENT - e = pthread_mutex_consistent_np (&m1); + e = pthread_mutex_consistent (&m1); if (e != 0) { printf ("%ld: mutex_consistent m1 failed with error %d\n", ro |
