Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 2003 08:12:24 +0800
From:      "David Xu" <davidxu@freebsd.org>
To:        "Daniel Eischen" <eischen@pcnet1.pcnet.com>, "David Xu" <davidxu@viatech.com.cn>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: pthread_join
Message-ID:  <007401c30d1a$da3d7f40$0701a8c0@tiger>
References:  <Pine.GSO.4.10.10304271048300.20259-100000@pcnet1.pcnet.com>

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

In thr_cleanup(),  joinee accesses joiner without holding joiner's sched lock,
it is possible when joinee accesses joiner, the joiner may disappear (canceled).

if ((joiner->state == PS_JOIN) &&
		    (joiner->join_status.thread == thread)) {
			joiner->join_status.thread = NULL;

David Xu

----- Original Message ----- 
From: "Daniel Eischen" <eischen@pcnet1.pcnet.com>
To: "David Xu" <davidxu@viatech.com.cn>
Cc: <freebsd-threads@freebsd.org>
Sent: Sunday, April 27, 2003 11:02 PM
Subject: Re: pthread_join


> On Sun, 27 Apr 2003, David Xu wrote:
> > I found I can not get the following race fixed:
> > Thread A is a joiner of  thread B, thread C calls pthread_cancel on A,
> > because of multipile scheduler locks,  I can not get the race fixed. 
> > Is it possible we just use a single scheduler lock to simplify things a bit?
> 
> Hmm, you mean if thread A is already joined on B?  I don't see the
> race.  Everything looks right.  We don't take multiple scheduling
> locks at the same time, so everything should work.
> 
> -- 
> Dan Eischen
> 
> _______________________________________________
> freebsd-threads@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?007401c30d1a$da3d7f40$0701a8c0>