mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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:
parent
f790de29b9
commit
4dd715ced2
4 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue