Re: checking for thread existance
Re: checking for thread existance
- Subject: Re: checking for thread existance
- From: Dave DeLong <email@hidden>
- Date: Sat, 16 Oct 2010 12:46:13 -0600
You can save the NSThread instance in an ivar (after alloc/init'ing it), and then use all the NSThread methods to figure out what to do. (Don't forget to -start the thread when you're ready to kick it off)
Dave
On Oct 16, 2010, at 12:44 PM, Shane wrote:
> I have an application which launches worker threads via NSThread's
> detachNewThreadSelector: method, and once the thread is setup, it's
> listening for commands from the main GUI thread.
>
> So, what I'd like to do is know how to check to see if a thread exists
> when a button is clicked where it would normally setup a new thread. I
> guess I could just send a command to the thread and try to get a
> response, and upon error, just assume that it should create a new
> thread. But I'd think there's a better way for checking thread
> existence.
>
> Anyone have ideas on how to do this?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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