• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: waiting for an NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: waiting for an NSThread


  • Subject: Re: waiting for an NSThread
  • From: "Michael Ash" <email@hidden>
  • Date: Mon, 13 Oct 2008 22:01:12 -0400

On Mon, Oct 13, 2008 at 3:20 PM, Ken Thomases <email@hidden> wrote:
> 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.

And if you must support 10.4 or below, merely register for the
notification from the thread you wish to monitor.

Mike
_______________________________________________

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

References: 
 >Re: waiting for an NSThread (From: Scott Ribe <email@hidden>)
 >Re: waiting for an NSThread (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Add animation layer and then remove animation layer
  • Next by Date: Re: Status Item menus don't open on hover
  • Previous by thread: Re: waiting for an NSThread
  • Next by thread: Re: waiting for an NSThread
  • Index(es):
    • Date
    • Thread