Re: How to know, which NSThread has terminated?
Re: How to know, which NSThread has terminated?
- Subject: Re: How to know, which NSThread has terminated?
- From: Philip Mötteli <email@hidden>
- Date: Sat, 29 May 2004 09:18:15 +0200
Am 29.05.2004 um 04:22 schrieb Nick Zitzmann:
On May 28, 2004, at 5:57 PM, Philip Mvtteli wrote:
I have no idea how to recognize this just created thread later, when
it terminates. What I need is something like a handle. I mean
objc_thread_detach() gives back an objc_thread_t too.
I could put some flag into the tread dictionary, but it would be so
much nicer to be able to just ask the thread for its handle or to
keep the address of the NSThread instance.
Here's an idea: Send a notification to the main thread using
-performSelectorOnMainThread: with the NSThread object (using
NSThread's +currentThread class method to obtain an address) as the
notification's embedded object. I don't see why that wouldn't work,
Good idea, but I create a lot of threads from different objects. How
can I be sure, that not in the same moment (or slightly before or
afterwards) another thread is forking a thread, so sending this
notification? Or, as far as I know, performInMainThread would be
executed, when the main thread enters the next time the runloop. So I
could have forked several other threads, which' notifications would
then be subsequently queued in the event queue.
Thanks
Phil
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.