diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-09-22 14:40:36 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-09-22 14:40:36 +0000 |
commit | eed69ab82ae4c7052d1198d62bae3532d52e29ea (patch) | |
tree | cce20a533a8a40682f6807e09361d4aa83436201 /lib | |
parent | b429e207503a0d7e9706973510bcb2f4ba914f24 (diff) | |
download | FreeBSD-src-eed69ab82ae4c7052d1198d62bae3532d52e29ea.zip FreeBSD-src-eed69ab82ae4c7052d1198d62bae3532d52e29ea.tar.gz |
Save and restore timeout field for signal frame just like what we did
for interrupted field.
Also in _thr_sig_handler, retrieve current signal mask from kernel not
from ucp, the later is pre-unioned mask, not current signal mask.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_private.h | 1 | ||||
-rw-r--r-- | lib/libkse/thread/thr_sig.c | 4 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_private.h | 1 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_sig.c | 4 |
4 files changed, 8 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_private.h b/lib/libkse/thread/thr_private.h index 7738f37..f6ae1e2 100644 --- a/lib/libkse/thread/thr_private.h +++ b/lib/libkse/thread/thr_private.h @@ -580,6 +580,7 @@ struct pthread_sigframe { int psf_valid; int psf_flags; int psf_interrupted; + int psf_timeout; int psf_signo; enum pthread_state psf_state; union pthread_wait_data psf_wait_data; diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index ad51631..5459c61 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/thread/thr_sig.c @@ -349,7 +349,7 @@ _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp) intr_save = curthread->interrupted; _kse_critical_enter(); /* Get a fresh copy of signal mask */ - curthread->sigmask = ucp->uc_sigmask; + __sys_sigprocmask(SIG_BLOCK, NULL, &curthread->sigmask); KSE_LOCK_ACQUIRE(curkse, &_thread_signal_lock); sigfunc = _thread_sigact[sig - 1].sa_sigaction; sa_flags = _thread_sigact[sig - 1].sa_flags & SA_SIGINFO; @@ -1072,6 +1072,7 @@ thr_sigframe_restore(struct pthread *thread, struct pthread_sigframe *psf) PANIC("invalid pthread_sigframe\n"); thread->flags = psf->psf_flags; thread->interrupted = psf->psf_interrupted; + thread->timeout = psf->psf_timeout; thread->state = psf->psf_state; thread->data = psf->psf_wait_data; thread->wakeup_time = psf->psf_wakeup_time; @@ -1084,6 +1085,7 @@ thr_sigframe_save(struct pthread *thread, struct pthread_sigframe *psf) psf->psf_flags = thread->flags & (THR_FLAGS_PRIVATE | THR_FLAGS_IN_TDLIST); psf->psf_interrupted = thread->interrupted; + psf->psf_timeout = thread->timeout; psf->psf_state = thread->state; psf->psf_wait_data = thread->data; psf->psf_wakeup_time = thread->wakeup_time; diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index 7738f37..f6ae1e2 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -580,6 +580,7 @@ struct pthread_sigframe { int psf_valid; int psf_flags; int psf_interrupted; + int psf_timeout; int psf_signo; enum pthread_state psf_state; union pthread_wait_data psf_wait_data; diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c index ad51631..5459c61 100644 --- a/lib/libpthread/thread/thr_sig.c +++ b/lib/libpthread/thread/thr_sig.c @@ -349,7 +349,7 @@ _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp) intr_save = curthread->interrupted; _kse_critical_enter(); /* Get a fresh copy of signal mask */ - curthread->sigmask = ucp->uc_sigmask; + __sys_sigprocmask(SIG_BLOCK, NULL, &curthread->sigmask); KSE_LOCK_ACQUIRE(curkse, &_thread_signal_lock); sigfunc = _thread_sigact[sig - 1].sa_sigaction; sa_flags = _thread_sigact[sig - 1].sa_flags & SA_SIGINFO; @@ -1072,6 +1072,7 @@ thr_sigframe_restore(struct pthread *thread, struct pthread_sigframe *psf) PANIC("invalid pthread_sigframe\n"); thread->flags = psf->psf_flags; thread->interrupted = psf->psf_interrupted; + thread->timeout = psf->psf_timeout; thread->state = psf->psf_state; thread->data = psf->psf_wait_data; thread->wakeup_time = psf->psf_wakeup_time; @@ -1084,6 +1085,7 @@ thr_sigframe_save(struct pthread *thread, struct pthread_sigframe *psf) psf->psf_flags = thread->flags & (THR_FLAGS_PRIVATE | THR_FLAGS_IN_TDLIST); psf->psf_interrupted = thread->interrupted; + psf->psf_timeout = thread->timeout; psf->psf_state = thread->state; psf->psf_wait_data = thread->data; psf->psf_wakeup_time = thread->wakeup_time; |