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.
This commit is contained in:
David Xu 2003-09-22 14:40:36 +00:00
parent b1f054a092
commit 4841159528
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120338
4 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;