Re: some NSThread questions
Re: some NSThread questions
- Subject: Re: some NSThread questions
- From: Koen van der Drift <email@hidden>
- Date: Tue, 1 Jun 2004 20:08:05 -0400
On May 31, 2004, at 8:42 PM, Dustin Voss wrote:
Threads can only safely stop themselves. The thread will have to
periodically check a flag to see if it should keep running. When you
want the thread to stop, set the flag. The thread should stop itself
(by exiting -run:) the next time it checks the flag.
That is not possible with the code I am porting, I'm afraid. The
original code (not mine :) is written as one long sequence of various
calculations without a possibility to hook into it. Unless I really
tear apart the code, but I rather leave the original code intact as
much as possible, I am only wrapping it in a OS X GUI.
Thanks for the suggestion of performSelectorOnMainThread though, that
works like a charm.
- Koen.
_______________________________________________
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.