@@ -48,14 +48,8 @@ int *__libc_multiple_threads_ptr attribute_hidden;
size_t __static_tls_size;
size_t __static_tls_align_m1;
-#ifndef __ASSUME_SET_ROBUST_LIST
/* Negative if we do not have the system call and we can use it. */
-int __set_robust_list_avail;
-# define set_robust_list_not_avail() \
- __set_robust_list_avail = -1
-#else
-# define set_robust_list_not_avail() do { } while (0)
-#endif
+int __set_robust_list_avail = -1;
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
/* Nonzero if we do not have FUTEX_CLOCK_REALTIME. */
@@ -335,9 +329,9 @@ __pthread_initialize_minimal_internal (void)
INTERNAL_SYSCALL_DECL (err);
int res = INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
sizeof (struct robust_list_head));
- if (INTERNAL_SYSCALL_ERROR_P (res, err))
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ __set_robust_list_avail = 1;
#endif
- set_robust_list_not_avail ();
}
#ifdef __NR_futex
@@ -199,10 +199,8 @@ hidden_proto (__pthread_keys)
/* Number of threads running. */
extern unsigned int __nptl_nthreads attribute_hidden;
-#ifndef __ASSUME_SET_ROBUST_LIST
/* Negative if we do not have the system call and we can use it. */
extern int __set_robust_list_avail attribute_hidden;
-#endif
/* Thread Priority Protection. */
extern int __sched_fifo_min_prio attribute_hidden;
@@ -271,18 +271,16 @@ START_THREAD_DEFN
if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2))
futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE);
-#ifdef __NR_set_robust_list
-# ifndef __ASSUME_SET_ROBUST_LIST
if (__set_robust_list_avail >= 0)
-# endif
{
+#ifdef __NR_set_robust_list
INTERNAL_SYSCALL_DECL (err);
/* This call should never fail because the initial call in init.c
succeeded. */
INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
sizeof (struct robust_list_head));
- }
#endif
+ }
#ifdef SIGCANCEL
/* If the parent was running cancellation handlers while creating
@@ -388,7 +386,6 @@ START_THREAD_DEFN
the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE. */
atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
-#ifndef __ASSUME_SET_ROBUST_LIST
/* If this thread has any robust mutexes locked, handle them now. */
# ifdef __PTHREAD_MUTEX_HAVE_PREV
void *robust = pd->robust_head.list;
@@ -419,7 +416,6 @@ START_THREAD_DEFN
}
while (robust != (void *) &pd->robust_head);
}
-#endif
/* Mark the memory of the stack as usable to the kernel. We free
everything except for the space used for the TCB itself. */
@@ -91,11 +91,9 @@ __pthread_mutex_init (pthread_mutex_t *mutex,
if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0)
{
-#ifndef __ASSUME_SET_ROBUST_LIST
if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0
&& __set_robust_list_avail < 0)
return ENOTSUP;
-#endif
mutex->__data.__kind |= PTHREAD_MUTEX_ROBUST_NORMAL_NP;
}