diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-10-01 17:20:34 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-10-01 17:20:34 +0000 |
commit | dff9a7a163e9f5e28f36f9a701acf74f8f9d7968 (patch) | |
tree | ff9dbb35ab56c666e5d3f2a22bd067a8cf1fd54b /nptl/descr.h | |
parent | 2ff89ea46f2c817ad7dd5ce5dc0cc1119da861b6 (diff) | |
download | glibc-dff9a7a163e9f5e28f36f9a701acf74f8f9d7968.tar glibc-dff9a7a163e9f5e28f36f9a701acf74f8f9d7968.tar.gz glibc-dff9a7a163e9f5e28f36f9a701acf74f8f9d7968.tar.bz2 glibc-dff9a7a163e9f5e28f36f9a701acf74f8f9d7968.zip |
2005-10-01 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* descr.h: Define SETXID_BIT and SETXID_BITMASK. Adjust
CANCEL_RESTMASK.
(struct pthread): Move specific_used field to avoid padding.
Add setxid_futex field.
* init.c (sighandler_setxid): Reset setxid flag and release the
setxid futex.
* allocatestack.c (setxid_signal_thread): New function. Broken
out of the bodies of the two loops in __nptl_setxid. For undetached
threads check whether they are exiting and if yes, don't send a signal.
(__nptl_setxid): Simplify loops by using setxid_signal_thread.
* pthread_create.c (start_thread): For undetached threads, check
whether setxid bit is set. If yes, wait until signal has been
processed.
* allocatestack.c (STACK_VARIABLES): Initialize them.
* pthread_create.c (__pthread_create_2_1): Initialize pd.
Diffstat (limited to 'nptl/descr.h')
-rw-r--r-- | nptl/descr.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/nptl/descr.h b/nptl/descr.h index 77251d5e45..aaef9bc621 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -161,8 +161,11 @@ struct pthread /* Bit set if thread terminated and TCB is freed. */ #define TERMINATED_BIT 5 #define TERMINATED_BITMASK 0x20 + /* Bit set if thread is supposed to change XID. */ +#define SETXID_BIT 6 +#define SETXID_BITMASK 0x40 /* Mask for the rest. Helps the compiler to optimize. */ -#define CANCEL_RESTMASK 0xffffffc0 +#define CANCEL_RESTMASK 0xffffff80 #define CANCEL_ENABLED_AND_CANCELED(value) \ (((value) & (CANCELSTATE_BITMASK | CANCELED_BITMASK | EXITING_BITMASK \ @@ -185,12 +188,12 @@ struct pthread void *data; } specific_1stblock[PTHREAD_KEY_2NDLEVEL_SIZE]; - /* Flag which is set when specific data is set. */ - bool specific_used; - /* Two-level array for the thread-specific data. */ struct pthread_key_data *specific[PTHREAD_KEY_1STLEVEL_SIZE]; + /* Flag which is set when specific data is set. */ + bool specific_used; + /* True if events must be reported. */ bool report_events; @@ -203,6 +206,9 @@ struct pthread /* Lock to synchronize access to the descriptor. */ lll_lock_t lock; + /* Lock for synchronizing setxid calls. */ + lll_lock_t setxid_futex; + #if HP_TIMING_AVAIL /* Offset of the CPU clock at start thread start time. */ hp_timing_t cpuclock_offset; |