svn commit: r251834 - stable/9/lib/libthr/thread

Konstantin Belousov kib at FreeBSD.org
Mon Jun 17 07:12:35 UTC 2013


Author: kib
Date: Mon Jun 17 07:12:34 2013
New Revision: 251834
URL: http://svnweb.freebsd.org/changeset/base/251834

Log:
  MFC r251284:
  Unify the code of check_deferred_signal() for all architectures.

Modified:
  stable/9/lib/libthr/thread/thr_sig.c
Directory Properties:
  stable/9/lib/libthr/   (props changed)

Modified: stable/9/lib/libthr/thread/thr_sig.c
==============================================================================
--- stable/9/lib/libthr/thread/thr_sig.c	Mon Jun 17 07:11:17 2013	(r251833)
+++ stable/9/lib/libthr/thread/thr_sig.c	Mon Jun 17 07:12:34 2013	(r251834)
@@ -318,31 +318,23 @@ check_deferred_signal(struct pthread *cu
 	ucontext_t *uc;
 	struct sigaction act;
 	siginfo_t info;
+	int uc_len;
 
 	if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
 		return;
 
-#if defined(__amd64__) || defined(__i386__)
-	int uc_len;
 	uc_len = __getcontextx_size();
 	uc = alloca(uc_len);
 	getcontext(uc);
 	if (curthread->deferred_siginfo.si_signo == 0)
 		return;
 	__fillcontextx2((char *)uc);
-#else
-	ucontext_t ucv;
-	uc = &ucv;
-	getcontext(uc);
-#endif
-	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));
-		/* remove signal */
-		curthread->deferred_siginfo.si_signo = 0;
-		handle_signal(&act, info.si_signo, &info, uc);
-	}
+	act = curthread->deferred_sigact;
+	uc->uc_sigmask = curthread->deferred_sigmask;
+	memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));
+	/* remove signal */
+	curthread->deferred_siginfo.si_signo = 0;
+	handle_signal(&act, info.si_signo, &info, uc);
 }
 
 static void


More information about the svn-src-stable-9 mailing list