From owner-freebsd-threads@FreeBSD.ORG Thu Sep 23 15:08:50 2004 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 7BA8716A4CE; Thu, 23 Sep 2004 15:08:50 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F197343D1D; Thu, 23 Sep 2004 15:08:46 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.64] (HELO rogue.acs.lan) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP id 58067787; Thu, 23 Sep 2004 18:01:41 +0300 Received: by rogue.acs.lan (Postfix, from userid 1000) id 42F1DB86E; Thu, 23 Sep 2004 18:08:58 +0300 (EAT) Date: Thu, 23 Sep 2004 18:08:58 +0300 From: Mike Makonnen To: Andrew Belashov Message-ID: <20040923150857.GA51350@rogue.acs.lan> References: <4152BECE.5080202@orel.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <4152BECE.5080202@orel.ru> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/6.0-CURRENT (i386) cc: Daniel Eischen cc: freebsd-sparc64@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Bug in kse_switchin()? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2004 15:08:50 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 23, 2004 at 04:17:18PM +0400, Andrew Belashov wrote: > Daniel Eischen wrote: > >Wouldn't you also see same behavior (bugs) in other things, like > >getcontext(), setcontext(), and swapcontext() (kern_context.c)? > > No. uap structure is not used after set_mcontext(). So, the attached change to thr_create should work as far as libthr is concerned then? BTW, have you tried libthr on sparc64, and if so how does it work? Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff Index: sys/kern/kern_thr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_thr.c,v retrieving revision 1.27 diff -u -r1.27 kern_thr.c --- sys/kern/kern_thr.c 7 Sep 2004 07:04:47 -0000 1.27 +++ sys/kern/kern_thr.c 23 Sep 2004 15:06:04 -0000 @@ -76,9 +76,11 @@ int error; struct ksegrp *kg, *newkg; struct proc *p; + int flags; p = td->td_proc; kg = td->td_ksegrp; + flags = uap->flags; if ((error = copyin(uap->ctx, &ctx, sizeof(ctx)))) return (error); @@ -158,7 +160,7 @@ sched_fork_thread(td, newtd); TD_SET_CAN_RUN(newtd); - if ((uap->flags & THR_SUSPENDED) == 0) + if ((flags & THR_SUSPENDED) == 0) setrunqueue(newtd, SRQ_BORING); mtx_unlock_spin(&sched_lock); --wac7ysb48OaltWcw--