Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: kernel thread join?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kernel thread join?



There isn't really a 100% reliable way of waiting for a thread to terminate completely. However that isn't really a problem. The key is to recognise what you are really trying to do.

Presumably you are trying to clean up resources that the thread may be using?

In this case the correct kernel way of cleaning this up is just to reference count your resources. Then it doesn't matter exactly what order the objects get released in. There are a couple of other tricks but the OSObject reference counting will probably get you out of trouble.

Cheers

Godfrey

On 2008-04-12, at 5:08 , Duane Murphy wrote:

What is the equivalent of pthread_join() for a kernel thread?

I am using IOThreadCreate() to create a new thread. At some later point
I indicate to that thread to stop. How do I detect that the thread as exited?


Thanks,

...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: 
 >kernel thread join? (From: "Duane Murphy" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.