@@ -276,7 +276,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
if (__glibc_likely (! not_first_call))
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
unwind_buf.priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
@@ -1094,7 +1094,7 @@ __nptl_setxid (struct xid_command *cmdp)
cmdp->cntr = 0;
cmdp->error = -1;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Iterate over the list with system-allocated threads first. */
list_t *runp;
@@ -1235,7 +1235,7 @@ __wait_lookup_done (void)
{
lll_lock (stack_cache_lock, LLL_PRIVATE);
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Iterate over the list with system-allocated threads first. */
list_t *runp;
@@ -29,7 +29,7 @@ int
attribute_hidden
__pthread_enable_asynccancel (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -69,7 +69,7 @@ __pthread_disable_asynccancel (int oldtype)
if (oldtype & CANCELTYPE_BITMASK)
return;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int newval;
int oldval = THREAD_GETMEM (self, cancelhandling);
@@ -25,7 +25,7 @@ __cleanup_fct_attribute
__pthread_register_cancel (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
@@ -26,7 +26,7 @@ _pthread_cleanup_push (buffer, routine, arg)
void (*routine) (void *);
void *arg;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
buffer->__routine = routine;
buffer->__arg = arg;
@@ -42,7 +42,7 @@ _pthread_cleanup_pop (buffer, execute)
struct _pthread_cleanup_buffer *buffer;
int execute;
{
- struct pthread *self __attribute ((unused)) = THREAD_SELF;
+ pthread_self_t *self __attribute ((unused)) = THREAD_SELF;
THREAD_SETMEM (self, cleanup, buffer->__prev);
@@ -25,7 +25,7 @@ __cleanup_fct_attribute
__pthread_register_cancel_defer (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Store old info. */
ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
@@ -62,7 +62,7 @@ void
__cleanup_fct_attribute
__pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
THREAD_SETMEM (self, cleanup_jmp_buf, ibuf->priv.data.prev);
@@ -25,7 +25,7 @@ _pthread_cleanup_push_defer (buffer, routine, arg)
void (*routine) (void *);
void *arg;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
buffer->__routine = routine;
buffer->__arg = arg;
@@ -63,7 +63,7 @@ _pthread_cleanup_pop_restore (buffer, execute)
struct _pthread_cleanup_buffer *buffer;
int execute;
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
THREAD_SETMEM (self, cleanup, buffer->__prev);
@@ -199,7 +199,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
|| si->si_code != SI_TKILL)
return;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -268,7 +268,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
__nptl_setxid_error (__xidcmd, error);
/* Reset the SETXID flag. */
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int flags, newval;
do
{
@@ -312,7 +312,7 @@ __pthread_initialize_minimal_internal (void)
#endif
/* Minimal initialization of the thread descriptor. */
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
__pthread_initialize_pids (pd);
THREAD_SETMEM (pd, specific[0], &pd->specific_1stblock[0]);
THREAD_SETMEM (pd, user_stack, true);
@@ -24,7 +24,7 @@
void
__pthread_cleanup_upto (__jmp_buf target, char *targetframe)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct _pthread_cleanup_buffer *cbuf;
/* Adjust all pointers used in comparisons, so that top of thread's
@@ -275,7 +275,7 @@ static inline void
__attribute ((noreturn, always_inline))
__do_cancel (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Make sure we get no more cancellations. */
THREAD_ATOMIC_BIT_SET (self, cancelhandling, EXITING_BIT);
@@ -124,7 +124,7 @@ void
attribute_hidden
__nptl_deallocate_tsd (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
/* Maybe no data was ever allocated. This happens often so we have
a flag for this. */
@@ -559,7 +559,7 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
pd->arg = arg;
/* Copy the thread attribute flags. */
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
pd->flags = ((iattr->flags & ~(ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET))
| (self->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)));
@@ -51,7 +51,7 @@ pthread_join (pthread_t threadid, void **thread_return)
/* We cannot wait for the thread. */
return EINVAL;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
int result = 0;
LIBC_PROBE (pthread_join, 1, threadid);
@@ -26,12 +26,10 @@ __pthread_setcancelstate (state, oldstate)
int state;
int *oldstate;
{
- volatile struct pthread *self;
-
if (state < PTHREAD_CANCEL_ENABLE || state > PTHREAD_CANCEL_DISABLE)
return EINVAL;
- self = THREAD_SELF;
+ volatile pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -34,7 +34,7 @@ __pthread_setcanceltype (type, oldtype)
return ENOTSUP;
#endif
- volatile struct pthread *self = THREAD_SELF;
+ volatile pthread_self_t *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)
@@ -26,14 +26,12 @@ __pthread_setspecific (key, value)
pthread_key_t key;
const void *value;
{
- struct pthread *self;
+ pthread_self_t *self = THREAD_SELF;
unsigned int idx1st;
unsigned int idx2nd;
struct pthread_key_data *level2;
unsigned int seq;
- self = THREAD_SELF;
-
/* Special case access to the first 2nd-level block. This is the
usual case. */
if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
@@ -33,7 +33,6 @@ int
pthread_timedjoin_np (pthread_t threadid, void **thread_return,
const struct timespec *abstime)
{
- struct pthread *self;
struct pthread *pd = (struct pthread *) threadid;
int result;
@@ -47,7 +46,7 @@ pthread_timedjoin_np (pthread_t threadid, void **thread_return,
/* We cannot wait for the thread. */
return EINVAL;
- self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if (pd == self || self->joinid == pd)
/* This is a deadlock situation. The threads are waiting for each
other to finish. Note that this is a "may" error. To be 100%
@@ -28,7 +28,6 @@ pthread_tryjoin_np (threadid, thread_return)
pthread_t threadid;
void **thread_return;
{
- struct pthread *self;
struct pthread *pd = (struct pthread *) threadid;
/* Make sure the descriptor is valid. */
@@ -41,7 +40,7 @@ pthread_tryjoin_np (threadid, thread_return)
/* We cannot wait for the thread. */
return EINVAL;
- self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if (pd == self || self->joinid == pd)
/* This is a deadlock situation. The threads are waiting for each
other to finish. Note that this is a "may" error. To be 100%
@@ -51,7 +51,7 @@ __init_sched_fifo_prio (void)
int
__pthread_tpp_change_priority (int previous_prio, int new_prio)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct priority_protection_data *tpp = THREAD_GETMEM (self, tpp);
int fifo_min_prio = atomic_load_relaxed (&__sched_fifo_min_prio);
int fifo_max_prio = atomic_load_relaxed (&__sched_fifo_max_prio);
@@ -158,7 +158,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
int
__pthread_current_priority (void)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
if ((self->flags & (ATTR_FLAG_POLICY_SET | ATTR_FLAG_SCHED_SET))
== (ATTR_FLAG_POLICY_SET | ATTR_FLAG_SCHED_SET))
return self->schedparam.sched_priority;
@@ -44,7 +44,7 @@ unwind_stop (int version, _Unwind_Action actions,
struct _Unwind_Context *context, void *stop_parameter)
{
struct pthread_unwind_buf *buf = stop_parameter;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
struct _pthread_cleanup_buffer *curp = THREAD_GETMEM (self, cleanup);
int do_longjump = 0;
@@ -115,7 +115,7 @@ __cleanup_fct_attribute __attribute ((noreturn))
__pthread_unwind (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
#ifdef HAVE_FORCED_UNWIND
/* This is not a catchable exception, so don't provide any details about
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -53,6 +53,8 @@ typedef struct
void *__private;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
/* This is the size of the initial TCB. */
# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -64,6 +64,8 @@ typedef struct
void *__private_ss;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# define TLS_MULTIPLE_THREADS_IN_TCB 1
#else /* __ASSEMBLER__ */
@@ -46,7 +46,8 @@ typedef struct
void *__private;
} tcbhead_t;
-register struct pthread *__thread_self __asm__("r13");
+typedef struct pthread pthread_self_t;
+register pthread_self_t *__thread_self __asm__("r13");
# define TLS_MULTIPLE_THREADS_IN_TCB 1
@@ -38,6 +38,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -54,6 +54,9 @@ typedef struct
/* GCC split stack support. */
void *__private_ss;
} tcbhead_t;
+
+typedef struct pthread pthread_self_t;
+
#endif
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -39,6 +39,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#ifdef __mips16
/* MIPS16 uses GCC builtin to access the TP. */
# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
@@ -29,7 +29,7 @@
static inline void __attribute__ ((noreturn, always_inline, unused))
__exit_thread (void)
{
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
/* The generic logic for pthread_join and stack/descriptor reuse is
based on the Linux kernel feature that will clear and futex-wake
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -131,7 +131,7 @@ __libc_fork (void)
if (pid == 0)
{
- struct pthread *self = THREAD_SELF;
+ pthread_self_t *self = THREAD_SELF;
assert (THREAD_GETMEM (self, tid) != ppid);
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -56,6 +56,8 @@ typedef struct
#endif
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# ifndef __s390x__
# define TLS_MULTIPLE_THREADS_IN_TCB 1
# endif
@@ -46,6 +46,8 @@ typedef struct
uintptr_t pointer_guard;
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
# define TLS_MULTIPLE_THREADS_IN_TCB 1
#else /* __ASSEMBLER__ */
@@ -60,6 +60,8 @@ typedef struct
#endif
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -37,6 +37,8 @@ typedef union dtv
} pointer;
} dtv_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -27,7 +27,7 @@ int
raise (sig)
int sig;
{
- struct pthread *pd = THREAD_SELF;
+ pthread_self_t *pd = THREAD_SELF;
pid_t pid = THREAD_GETMEM (pd, pid);
pid_t selftid = THREAD_GETMEM (pd, tid);
if (selftid == 0)
@@ -80,6 +80,8 @@ typedef struct
void *__padding[8];
} tcbhead_t;
+typedef struct pthread pthread_self_t;
+
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif