Re: Thread join?
Re: Thread join?
- Subject: Re: Thread join?
- From: Godfrey van der Linden <email@hidden>
- Date: Wed, 09 Dec 2009 17:03:16 +1100
IIRC there is no automatic way of doing this. In any case I had to roll my own with complicated locking and other weird hand off code. How is your thread terminating, are you returning from main or is it being aborted by another thread (if that is even possible)?
I've just had a look at the IOWorkLoop termination code, it is pretty complicated to get right it seems to be necessary to call thread_deallocate() followed by thread_terminate(), this is all new to me so something has changed since I last worked in this area.
Godfrey
On 2009-12-09, at 12:42 PM, Duane Murphy wrote:
> How would one do the equivalent of join() for a thread in the kernel?
>
> I think I have a situation where the underlying thread is exiting,
> possibly aborting, so that my built in thread exit indicators do not
> get called. This causes some threads to hang waiting for the thread to
> exit.
>
> Or maybe the right question is what is the appropriate way to wait on
> a thread that may abort or already be aborted?
>
> ...Duane
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Thread join? (From: Duane Murphy <email@hidden>) |