diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-04-21 07:39:20 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-04-21 07:39:20 +0000 |
commit | e7608d778994e0236b2fe66ec70bb0c5a0aa0282 (patch) | |
tree | d2156ad08ad4e71afe0e74b9245c0ded5ef0718e /nptl/sysdeps/unix/sysv | |
parent | a4faf24354ee98ef226a9012f2835cd771380882 (diff) | |
download | glibc-e7608d778994e0236b2fe66ec70bb0c5a0aa0282.tar glibc-e7608d778994e0236b2fe66ec70bb0c5a0aa0282.tar.gz glibc-e7608d778994e0236b2fe66ec70bb0c5a0aa0282.tar.bz2 glibc-e7608d778994e0236b2fe66ec70bb0c5a0aa0282.zip |
Update.
2003-04-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/sigprocmask.c: Prevent changing mask for
SIGCANCEL.
* sysdeps/unix/sysv/linux/alpha/bits/siginfo.h: Define SI_TKILL.
* sysdeps/unix/sysv/linux/bits/siginfo.h: Define SI_TKILL.
* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Define SI_TKILL.
* sysdeps/unix/sysv/linux/s390/bits/siginfo.h: Define SI_TKILL.
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h: Define SI_TKILL.
first syscall parameter to const char*.
Diffstat (limited to 'nptl/sysdeps/unix/sysv')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/allocrtsig.c | 2 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/timer_routines.c | 24 |
2 files changed, 18 insertions, 8 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/allocrtsig.c b/nptl/sysdeps/unix/sysv/linux/allocrtsig.c index 265416999a..51aeb22765 100644 --- a/nptl/sysdeps/unix/sysv/linux/allocrtsig.c +++ b/nptl/sysdeps/unix/sysv/linux/allocrtsig.c @@ -20,7 +20,7 @@ #include <signal.h> -static int current_rtmin = __SIGRTMIN + 2; +static int current_rtmin = __SIGRTMIN + 1; static int current_rtmax = __SIGRTMAX; diff --git a/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/nptl/sysdeps/unix/sysv/linux/timer_routines.c index e9ece9f488..b0d6ef91bf 100644 --- a/nptl/sysdeps/unix/sysv/linux/timer_routines.c +++ b/nptl/sysdeps/unix/sysv/linux/timer_routines.c @@ -49,6 +49,11 @@ timer_helper_thread (void *arg) sigset_t ss; sigemptyset (&ss); sigaddset (&ss, SIGTIMER); + /* SIGTIMER is the same signal as SIGCANCEL and it is therefore + unblocked so far. Block it for this thread, we handle + cancellation explicitly. */ + INTERNAL_SYSCALL_DECL (err); + INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &ss, NULL, _NSIG / 8); /* Endless loop of waiting for signals. The loop is only ended when the thread is canceled. */ @@ -56,14 +61,19 @@ timer_helper_thread (void *arg) { siginfo_t si; - if (sigwaitinfo (&ss, &si) > 0 && si.si_code == SI_TIMER) + if (sigwaitinfo (&ss, &si) > 0) { - - struct timer *tk = (struct timer *) si.si_ptr; - - /* That the signal we are waiting for. */ - pthread_t th; - (void) pthread_create (&th, &tk->attr, timer_sigev_thread, tk); + if (si.si_code == SI_TIMER) + { + struct timer *tk = (struct timer *) si.si_ptr; + + /* That the signal we are waiting for. */ + pthread_t th; + (void) pthread_create (&th, &tk->attr, timer_sigev_thread, tk); + } + else if (si.si_code == SI_TKILL) + /* The thread is canceled. */ + pthread_exit (NULL); } } } |