did you try looking at the documentation for NSThread? There's an NSThreadWillExitNotification listed there, sent to the default notification center just before the thread goes out of existence when +exit is called. Earlier in the documentation it says that after detachNewThreadSelector:toTarget:withObject: is called, the detached thread is exited (using the exit class method) as soon as aTarget has completed executing the aSelector method. So it would seem quite likely that notification would do what you want.

John Zorko wrote:


Hello, all ...

I've another n00b Cocoa question: How can I wait for a thread to finish without depending on a flag that may be reset and set before the thread i'm waiting for has time to check it? For instance, in Win32 (i'm not saying Win32 is the best, it's just what i've the most experience in), I can ::WaitForSingleObject(thread_id). In Cocoa, once I start the new thread via NSThread detachNewThreadSelector(), how can I be sure it ended i.e. how can I wait for it to end before starting another? Can I have Cocoa notify me when a thread ends, like it notifies me when an observed property changes?

Regards,

John

Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com











_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to