mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
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.
This commit is contained in:
11
nptl/init.c
11
nptl/init.c
@@ -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.
|
||||
|
||||
@@ -211,6 +211,15 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
|
||||
|
||||
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
|
||||
lll_futex_wake (&__xidcmd->cntr, 1);
|
||||
|
||||
/* Reset the SETXID flag. */
|
||||
struct pthread *self = THREAD_SELF;
|
||||
int flags = THREAD_GETMEM (self, cancelhandling);
|
||||
THREAD_SETMEM (self, cancelhandling, flags & ~SETXID_BITMASK);
|
||||
|
||||
/* And release the futex. */
|
||||
self->setxid_futex = 1;
|
||||
lll_futex_wake (&self->setxid_futex, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user