Re: waiting for an NSThread
Re: waiting for an NSThread
- Subject: Re: waiting for an NSThread
- From: Ken Thomases <email@hidden>
- Date: Mon, 13 Oct 2008 14:20:37 -0500
On Oct 13, 2008, at 9:32 AM, Scott Ribe wrote:
Isn't there a race condition there? Can't the thread exit before the
observer is added?
Well, you can register for the notification with 'nil' for the
object. That registers for all thread termination notifications. You
can do that before detaching the thread.
Alternatively, in 10.5 and later, you can create (alloc+init) an
NSThread, register for the notification, and only then start it.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden