svn commit: r214500 - head/lib/libthr/thread

David Xu davidxu at FreeBSD.org
Fri Oct 29 07:04:45 UTC 2010


Author: davidxu
Date: Fri Oct 29 07:04:45 2010
New Revision: 214500
URL: http://svn.freebsd.org/changeset/base/214500

Log:
  Remove local variable 'first', instead check signal number in memory,
  because the variable can be in register, second checking the variable
  may still return true, however this is unexpected.

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Fri Oct 29 02:12:36 2010	(r214499)
+++ head/lib/libthr/thread/thr_sig.c	Fri Oct 29 07:04:45 2010	(r214500)
@@ -317,14 +317,11 @@ check_deferred_signal(struct pthread *cu
 	ucontext_t uc;
 	struct sigaction act;
 	siginfo_t info;
-	volatile int first;
 
 	if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
 		return;
-	first = 1;
 	getcontext(&uc);
-	if (first) {
-		first = 0;
+	if (curthread->deferred_siginfo.si_signo == 0) {
 		act = curthread->deferred_sigact;
 		uc.uc_sigmask = curthread->deferred_sigmask;
 		memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));


More information about the svn-src-head mailing list