From owner-freebsd-threads@FreeBSD.ORG Sun Aug 17 16:31:21 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 161E037B401; Sun, 17 Aug 2003 16:31:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A699743F3F; Sun, 17 Aug 2003 16:31:20 -0700 (PDT) (envelope-from davidxu@FreeBSD.org) Received: from localhost (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7HNVIUp022617; Sun, 17 Aug 2003 16:31:19 -0700 (PDT) (envelope-from davidxu@FreeBSD.org) From: David Xu To: Marcel Moolenaar Date: Mon, 18 Aug 2003 07:34:21 +0800 User-Agent: KMail/1.5.2 References: <20030817185015.GB928@dhcp42.pn.xcllnt.net> <200308180647.52744.davidxu@FreeBSD.org> <20030817231246.GA17207@dhcp42.pn.xcllnt.net> In-Reply-To: <20030817231246.GA17207@dhcp42.pn.xcllnt.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308180734.21128.davidxu@FreeBSD.org> cc: threads@FreeBSD.org Subject: Re: First draft: rewrite of {get|set|swap}context(3) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2003 23:31:21 -0000 On Monday 18 August 2003 07:12, Marcel Moolenaar wrote: > On Mon, Aug 18, 2003 at 06:47:52AM +0800, David Xu wrote: > > Then doesn't signal context in signal handler have a UCF_SIGMASK ? > > Yes. > > > void (*__sa_sigaction)(int, struct __siginfo *, ucontext_t *ucp); > > the context *ucp should have UCF_SIGMASK now. > > We never define uc_flags currently. We only copyout() uc_sigmask and > uc_mcontext. Hence, the uc_flags field is garbage. As is the uc_stack > field. > > > I think it should be UCF_NOSIGMASK. But for libkse, we really needn't > > this kind of hack, because M:N thread in kernel always masks all signals, > > you can always SIGFILLSET(&uc.uc_sigmask) before call set_context. > > I tried this, but it didn't fix mutex_d. I can pass mutex_d if gettimeofday does not return -1, but it is strange that gettimeofday can return -1 and errno is EFAULT. so line 414 of mutex_d.c is asserted: assert (gettimeofday (&tv2, NULL) == 0); David Xu