diff options
author | kib <kib@FreeBSD.org> | 2013-11-30 14:36:32 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-11-30 14:36:32 +0000 |
commit | be650673e41a61818b5677339114010414c509a8 (patch) | |
tree | 2ba82ba0bcf59e0f400bbc5bc0b1580b890d1588 /lib/libthr/thread/thr_sig.c | |
parent | 5a0de0a477607f4055692a3c18a5273db56f2171 (diff) | |
download | FreeBSD-src-be650673e41a61818b5677339114010414c509a8.zip FreeBSD-src-be650673e41a61818b5677339114010414c509a8.tar.gz |
MFC r258499:
Fix for the spurious signal handler call with zero signo in the threaded
process.
Approved by: re (hrs)
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-rw-r--r-- | lib/libthr/thread/thr_sig.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index 415ddb0..57c9406 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -162,6 +162,7 @@ thr_sighandler(int sig, siginfo_t *info, void *_ucp) act = _thr_sigact[sig-1].sigact; _thr_rwl_unlock(&_thr_sigact[sig-1].lock); errno = err; + curthread->deferred_run = 0; /* * if a thread is in critical region, for example it holds low level locks, @@ -320,14 +321,18 @@ check_deferred_signal(struct pthread *curthread) siginfo_t info; int uc_len; - if (__predict_true(curthread->deferred_siginfo.si_signo == 0)) + if (__predict_true(curthread->deferred_siginfo.si_signo == 0 || + curthread->deferred_run)) return; + curthread->deferred_run = 1; uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); - if (curthread->deferred_siginfo.si_signo == 0) + if (curthread->deferred_siginfo.si_signo == 0) { + curthread->deferred_run = 0; return; + } __fillcontextx2((char *)uc); act = curthread->deferred_sigact; uc->uc_sigmask = curthread->deferred_sigmask; |