Re: Question about Threading
Re: Question about Threading
- Subject: Re: Question about Threading
- From: Cameron Hayne <email@hidden>
- Date: Mon, 8 Aug 2005 10:14:51 -0400
On 8-Aug-05, at 8:39 AM, Michael Becker wrote:
I have created a (class-wide) boolean variable which the thread
checks on each iteration to see whether it may continue or not.
However, I get synchronizing problems: When I set that boolean
variable to STOP the thread, how can I make sure that I wait until
the thread has finished its current iteration and then exited?
What (in general) is the best way of doing things like that?
You want to use NSLock.
You might find it useful to look at my example project "ImageCalc"
that illustrates use of NSLock:
http://hayne.net/MacDev/ImageCalc/
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden