mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
htl: move pthread_mutexattr_{setrobust, setrobust_np}, pthread_mutexattr_{getrobust, getrobust_np} into libc.
Message-ID: <20241231134909.1166440-8-gfleury@disroot.org>
This commit is contained in:
parent
1e5b39a5e0
commit
4371b11c86
9 changed files with 59 additions and 19 deletions
|
@ -56,8 +56,6 @@ libpthread-routines := \
|
|||
pt-cancel \
|
||||
pt-mutexattr-getprioceiling \
|
||||
pt-mutexattr-setprioceiling \
|
||||
pt-mutexattr-getrobust \
|
||||
pt-mutexattr-setrobust \
|
||||
pt-mutex-init \
|
||||
pt-mutex-destroy \
|
||||
pt-mutex-lock \
|
||||
|
@ -196,10 +194,12 @@ routines := \
|
|||
pt-mutexattr-destroy \
|
||||
pt-mutexattr-getprotocol \
|
||||
pt-mutexattr-getpshared \
|
||||
pt-mutexattr-getrobust \
|
||||
pt-mutexattr-gettype \
|
||||
pt-mutexattr-init \
|
||||
pt-mutexattr-setprotocol \
|
||||
pt-mutexattr-setpshared \
|
||||
pt-mutexattr-setrobust \
|
||||
pt-mutexattr-settype \
|
||||
pt-nthreads \
|
||||
pt-pthread_self \
|
||||
|
|
|
@ -76,6 +76,9 @@ libc {
|
|||
thrd_current; thrd_equal; thrd_sleep; thrd_yield;
|
||||
|
||||
pthread_cond_clockwait;
|
||||
|
||||
pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
|
||||
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
|
||||
}
|
||||
|
||||
GLIBC_2.41 {
|
||||
|
@ -93,9 +96,11 @@ libc {
|
|||
pthread_condattr_setpshared;
|
||||
pthread_mutexattr_getprotocol;
|
||||
pthread_mutexattr_getpshared;
|
||||
pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
|
||||
pthread_mutexattr_gettype;
|
||||
pthread_mutexattr_setprotocol;
|
||||
pthread_mutexattr_setpshared;
|
||||
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
|
||||
pthread_mutexattr_settype;
|
||||
pthread_sigmask;
|
||||
}
|
||||
|
@ -233,9 +238,6 @@ libpthread {
|
|||
cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
|
||||
tss_create; tss_delete; tss_get; tss_set;
|
||||
|
||||
pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np;
|
||||
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
|
||||
|
||||
pthread_mutex_consistent; pthread_mutex_consistent_np;
|
||||
pthread_mutex_clocklock;
|
||||
|
||||
|
|
|
@ -46,6 +46,22 @@ extern int __pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr,
|
|||
int __pshared);
|
||||
libc_hidden_proto (__pthread_mutexattr_setpshared)
|
||||
|
||||
/* Get the robustness flag of the mutex attribute ATTR. */
|
||||
extern int __pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
|
||||
int *__robustness);
|
||||
libc_hidden_proto (__pthread_mutexattr_getrobust)
|
||||
extern int __pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
|
||||
int *__robustness);
|
||||
libc_hidden_proto (__pthread_mutexattr_getrobust_np)
|
||||
extern int __pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
|
||||
int __robustness);
|
||||
libc_hidden_proto (__pthread_mutexattr_setrobust_np)
|
||||
|
||||
/* Set the robustness flag of the mutex attribute ATTR. */
|
||||
extern int __pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
|
||||
int __robustness);
|
||||
libc_hidden_proto (__pthread_mutexattr_setrobust)
|
||||
|
||||
extern int __pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr,
|
||||
int *__restrict __protocol);
|
||||
libc_hidden_proto (__pthread_mutexattr_getprotocol)
|
||||
|
|
|
@ -16,19 +16,26 @@
|
|||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <pthread.h>
|
||||
#include <pthreadP.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <pt-internal.h>
|
||||
#include "pt-mutex.h"
|
||||
#include <hurdlock.h>
|
||||
#include <shlib-compat.h>
|
||||
|
||||
int
|
||||
pthread_mutexattr_getrobust (const pthread_mutexattr_t *attrp, int *outp)
|
||||
__pthread_mutexattr_getrobust (const pthread_mutexattr_t *attrp, int *outp)
|
||||
{
|
||||
*outp = ((attrp->__prioceiling & PTHREAD_MUTEX_ROBUST)
|
||||
? PTHREAD_MUTEX_ROBUST : PTHREAD_MUTEX_STALLED);
|
||||
return 0;
|
||||
}
|
||||
libc_hidden_def (__pthread_mutexattr_getrobust)
|
||||
versioned_symbol (libc, __pthread_mutexattr_getrobust, pthread_mutexattr_getrobust, GLIBC_2_41);
|
||||
versioned_symbol (libc, __pthread_mutexattr_getrobust, pthread_mutexattr_getrobust_np, GLIBC_2_41);
|
||||
|
||||
weak_alias (pthread_mutexattr_getrobust, pthread_mutexattr_getrobust_np)
|
||||
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_41)
|
||||
compat_symbol (libpthread, __pthread_mutexattr_getrobust,pthread_mutexattr_getrobust, GLIBC_2_32);
|
||||
compat_symbol (libpthread, __pthread_mutexattr_getrobust,pthread_mutexattr_getrobust_np, GLIBC_2_32);
|
||||
#endif
|
||||
|
|
|
@ -16,15 +16,16 @@
|
|||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <pthread.h>
|
||||
#include <pthreadP.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <pt-internal.h>
|
||||
#include "pt-mutex.h"
|
||||
#include <hurdlock.h>
|
||||
#include <shlib-compat.h>
|
||||
|
||||
int
|
||||
pthread_mutexattr_setrobust (pthread_mutexattr_t *attrp, int robust)
|
||||
__pthread_mutexattr_setrobust (pthread_mutexattr_t *attrp, int robust)
|
||||
{
|
||||
if (robust != PTHREAD_MUTEX_ROBUST && robust != PTHREAD_MUTEX_STALLED)
|
||||
return EINVAL;
|
||||
|
@ -32,5 +33,11 @@ pthread_mutexattr_setrobust (pthread_mutexattr_t *attrp, int robust)
|
|||
attrp->__prioceiling |= robust;
|
||||
return 0;
|
||||
}
|
||||
libc_hidden_def (__pthread_mutexattr_setrobust)
|
||||
versioned_symbol (libc, __pthread_mutexattr_setrobust, pthread_mutexattr_setrobust, GLIBC_2_41);
|
||||
versioned_symbol (libc, __pthread_mutexattr_setrobust, pthread_mutexattr_setrobust_np, GLIBC_2_41);
|
||||
|
||||
weak_alias (pthread_mutexattr_setrobust, pthread_mutexattr_setrobust_np)
|
||||
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_41)
|
||||
compat_symbol (libpthread, __pthread_mutexattr_setrobust,pthread_mutexattr_setrobust, GLIBC_2_32);
|
||||
compat_symbol (libpthread, __pthread_mutexattr_setrobust,pthread_mutexattr_setrobust_np, GLIBC_2_32);
|
||||
#endif
|
||||
|
|
|
@ -2261,6 +2261,10 @@ GLIBC_2.32 __libc_single_threaded D 0x1
|
|||
GLIBC_2.32 mach_print F
|
||||
GLIBC_2.32 mremap F
|
||||
GLIBC_2.32 pthread_cond_clockwait F
|
||||
GLIBC_2.32 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.32 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.32 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.32 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.32 sigabbrev_np F
|
||||
GLIBC_2.32 sigdescr_np F
|
||||
GLIBC_2.32 strerrordesc_np F
|
||||
|
@ -2531,9 +2535,13 @@ GLIBC_2.41 pthread_condattr_setclock F
|
|||
GLIBC_2.41 pthread_condattr_setpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_getprotocol F
|
||||
GLIBC_2.41 pthread_mutexattr_getpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.41 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.41 pthread_mutexattr_gettype F
|
||||
GLIBC_2.41 pthread_mutexattr_setprotocol F
|
||||
GLIBC_2.41 pthread_mutexattr_setpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.41 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.41 pthread_mutexattr_settype F
|
||||
GLIBC_2.41 pthread_sigmask F
|
||||
GLIBC_2.5 __readlinkat_chk F
|
||||
|
|
|
@ -112,10 +112,6 @@ GLIBC_2.32 pthread_clockjoin_np F
|
|||
GLIBC_2.32 pthread_mutex_clocklock F
|
||||
GLIBC_2.32 pthread_mutex_consistent F
|
||||
GLIBC_2.32 pthread_mutex_consistent_np F
|
||||
GLIBC_2.32 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.32 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.32 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.32 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.32 pthread_rwlock_clockrdlock F
|
||||
GLIBC_2.32 pthread_rwlock_clockwrlock F
|
||||
GLIBC_2.32 pthread_timedjoin_np F
|
||||
|
|
|
@ -1554,10 +1554,14 @@ GLIBC_2.38 pthread_mutex_unlock F
|
|||
GLIBC_2.38 pthread_mutexattr_destroy F
|
||||
GLIBC_2.38 pthread_mutexattr_getprotocol F
|
||||
GLIBC_2.38 pthread_mutexattr_getpshared F
|
||||
GLIBC_2.38 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.38 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.38 pthread_mutexattr_gettype F
|
||||
GLIBC_2.38 pthread_mutexattr_init F
|
||||
GLIBC_2.38 pthread_mutexattr_setprotocol F
|
||||
GLIBC_2.38 pthread_mutexattr_setpshared F
|
||||
GLIBC_2.38 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.38 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.38 pthread_mutexattr_settype F
|
||||
GLIBC_2.38 pthread_self F
|
||||
GLIBC_2.38 pthread_setcancelstate F
|
||||
|
@ -2220,9 +2224,13 @@ GLIBC_2.41 pthread_condattr_setclock F
|
|||
GLIBC_2.41 pthread_condattr_setpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_getprotocol F
|
||||
GLIBC_2.41 pthread_mutexattr_getpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.41 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.41 pthread_mutexattr_gettype F
|
||||
GLIBC_2.41 pthread_mutexattr_setprotocol F
|
||||
GLIBC_2.41 pthread_mutexattr_setpshared F
|
||||
GLIBC_2.41 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.41 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.41 pthread_mutexattr_settype F
|
||||
GLIBC_2.41 pthread_sigmask F
|
||||
HURD_CTHREADS_0.3 __cthread_getspecific F
|
||||
|
|
|
@ -74,11 +74,7 @@ GLIBC_2.38 pthread_mutex_transfer_np F
|
|||
GLIBC_2.38 pthread_mutex_trylock F
|
||||
GLIBC_2.38 pthread_mutex_unlock F
|
||||
GLIBC_2.38 pthread_mutexattr_getprioceiling F
|
||||
GLIBC_2.38 pthread_mutexattr_getrobust F
|
||||
GLIBC_2.38 pthread_mutexattr_getrobust_np F
|
||||
GLIBC_2.38 pthread_mutexattr_setprioceiling F
|
||||
GLIBC_2.38 pthread_mutexattr_setrobust F
|
||||
GLIBC_2.38 pthread_mutexattr_setrobust_np F
|
||||
GLIBC_2.38 pthread_once F
|
||||
GLIBC_2.38 pthread_rwlock_clockrdlock F
|
||||
GLIBC_2.38 pthread_rwlock_clockwrlock F
|
||||
|
|
Loading…
Add table
Reference in a new issue