diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-11-01 10:49:34 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-11-01 10:49:34 +0000 |
commit | de118d09d13fd2498aba8b758d566d579ddeb24f (patch) | |
tree | 323e00dfac055efa845a1578c3f7fb540a6c929d /lib/libkse | |
parent | d9ced80d66fb0e025608df1ddcb2b0746a28f177 (diff) | |
download | FreeBSD-src-de118d09d13fd2498aba8b758d566d579ddeb24f.zip FreeBSD-src-de118d09d13fd2498aba8b758d566d579ddeb24f.tar.gz |
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
Diffstat (limited to 'lib/libkse')
-rw-r--r-- | lib/libkse/thread/thr_private.h | 1 | ||||
-rw-r--r-- | lib/libkse/thread/thr_sig.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_private.h b/lib/libkse/thread/thr_private.h index b681b3d..b8ccb43 100644 --- a/lib/libkse/thread/thr_private.h +++ b/lib/libkse/thread/thr_private.h @@ -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; diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index adca517..a54663a 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/thread/thr_sig.c @@ -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; |