pthread_join

David Xu davidxu at freebsd.org
Sun Apr 27 17:08:12 PDT 2003


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 at pcnet1.pcnet.com>
To: "David Xu" <davidxu at viatech.com.cn>
Cc: <freebsd-threads at 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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe at freebsd.org"
> 



More information about the freebsd-threads mailing list