Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Sep 2004 18:08:58 +0300
From:      Mike Makonnen <mtm@identd.net>
To:        Andrew Belashov <bel@orel.ru>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Bug in kse_switchin()?
Message-ID:  <20040923150857.GA51350@rogue.acs.lan>
In-Reply-To: <4152BECE.5080202@orel.ru>
References:  <Pine.GSO.4.43.0409230723320.7298-100000@sea.ntplx.net> <4152BECE.5080202@orel.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040923150857.GA51350>