1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2006-09-05  Ulrich Drepper  <drepper@redhat.com>
	[BZ #3124]
	* descr.h (struct pthread): Add parent_cancelhandling.
	* sysdeps/pthread/createthread.c (create_thread): Pass parent
	cancelhandling value to child.
	* pthread_create.c (start_thread): If parent thread was canceled
	reset the SIGCANCEL mask.
	* Makefile (tests): Add tst-cancel25.
	* tst-cancel25.c: New file.
This commit is contained in:
Ulrich Drepper
2006-09-05 17:18:23 +00:00
parent d052233c6c
commit b051fc4438
6 changed files with 202 additions and 2 deletions

View File

@ -251,6 +251,19 @@ start_thread (void *arg)
}
#endif
/* If the parent was running cancellation handlers while creating
the thread the new thread inherited the signal mask. Reset the
cancellation signal mask. */
if (__builtin_expect (pd->parent_cancelhandling & CANCELING_BITMASK, 0))
{
INTERNAL_SYSCALL_DECL (err);
sigset_t mask;
__sigemptyset (&mask);
__sigaddset (&mask, SIGCANCEL);
(void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &mask,
NULL, _NSIG / 8);
}
/* This is where the try/finally block should be created. For
compilers without that support we do use setjmp. */
struct pthread_unwind_buf unwind_buf;