From owner-cvs-all@FreeBSD.ORG Sat Jun 12 07:40:04 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69AF316A4CE; Sat, 12 Jun 2004 07:40:04 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6454A43D2F; Sat, 12 Jun 2004 07:40:04 +0000 (GMT) (envelope-from davidxu@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5C7e29w099400; Sat, 12 Jun 2004 07:40:02 GMT (envelope-from davidxu@repoman.freebsd.org) Received: (from davidxu@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5C7e288099399; Sat, 12 Jun 2004 07:40:02 GMT (envelope-from davidxu) Message-Id: <200406120740.i5C7e288099399@repoman.freebsd.org> From: David Xu Date: Sat, 12 Jun 2004 07:40:01 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libpthread/thread thr_create.c thr_private.h thr_sig.c thr_sigsuspend.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2004 07:40:04 -0000 davidxu 2004-06-12 07:40:01 UTC FreeBSD src repository Modified files: lib/libpthread/thread thr_create.c thr_private.h thr_sig.c thr_sigsuspend.c Log: Check pending signals, if there is signal will be unblocked by sigsuspend, thread shouldn't wait, in old code, it may be ignored. When a signal handler is invoked in sigsuspend, thread gets two different signal masks, one is in thread structure, sigprocmask() can retrieve it, another is in ucontext which is a third parameter of signal handler, the former is the result of sigsuspend mask ORed with sigaction's sa_mask and current signal, the later is the mask in thread structure before sigsuspend is called. After signal handler is called, the mask in ucontext should be copied into thread structure, and becomes CURRENT signal mask, then sigsuspend returns to user code. Reviewed by: deischen Tested by: Sean McNeil Revision Changes Path 1.54 +1 -0 src/lib/libpthread/thread/thr_create.c 1.114 +1 -0 src/lib/libpthread/thread/thr_private.h 1.78 +5 -1 src/lib/libpthread/thread/thr_sig.c 1.24 +18 -21 src/lib/libpthread/thread/thr_sigsuspend.c