Save cancelflags in signal frame, this fixes a problem that

a thread in pthread_cond_wait handled a signal can no longer
be canceled.

Reviewed by: deischen
This commit is contained in:
David Xu 2004-11-01 10:49:34 +00:00
parent f790de29b9
commit 4dd715ced2
4 changed files with 6 additions and 0 deletions

View File

@ -563,6 +563,7 @@ typedef void (*thread_continuation_t) (void *);
struct pthread_sigframe {
int psf_valid;
int psf_flags;
int psf_cancelflags;
int psf_interrupted;
int psf_timeout;
int psf_signo;

View File

@ -1188,6 +1188,7 @@ thr_sigframe_restore(struct pthread *thread, struct pthread_sigframe *psf)
if (psf->psf_valid == 0)
PANIC("invalid pthread_sigframe\n");
thread->flags = psf->psf_flags;
thread->cancelflags = psf->psf_cancelflags;
thread->interrupted = psf->psf_interrupted;
thread->timeout = psf->psf_timeout;
thread->state = psf->psf_state;
@ -1200,6 +1201,7 @@ thr_sigframe_save(struct pthread *thread, struct pthread_sigframe *psf)
{
/* This has to initialize all members of the sigframe. */
psf->psf_flags = thread->flags & THR_FLAGS_PRIVATE;
psf->psf_cancelflags = thread->cancelflags;
psf->psf_interrupted = thread->interrupted;
psf->psf_timeout = thread->timeout;
psf->psf_state = thread->state;

View File

@ -563,6 +563,7 @@ typedef void (*thread_continuation_t) (void *);
struct pthread_sigframe {
int psf_valid;
int psf_flags;
int psf_cancelflags;
int psf_interrupted;
int psf_timeout;
int psf_signo;

View File

@ -1188,6 +1188,7 @@ thr_sigframe_restore(struct pthread *thread, struct pthread_sigframe *psf)
if (psf->psf_valid == 0)
PANIC("invalid pthread_sigframe\n");
thread->flags = psf->psf_flags;
thread->cancelflags = psf->psf_cancelflags;
thread->interrupted = psf->psf_interrupted;
thread->timeout = psf->psf_timeout;
thread->state = psf->psf_state;
@ -1200,6 +1201,7 @@ thr_sigframe_save(struct pthread *thread, struct pthread_sigframe *psf)
{
/* This has to initialize all members of the sigframe. */
psf->psf_flags = thread->flags & THR_FLAGS_PRIVATE;
psf->psf_cancelflags = thread->cancelflags;
psf->psf_interrupted = thread->interrupted;
psf->psf_timeout = thread->timeout;
psf->psf_state = thread->state;