Re: Re: Yielding an NSThread-started thread
Re: Re: Yielding an NSThread-started thread
- Subject: Re: Re: Yielding an NSThread-started thread
- From: "Philip Q" <email@hidden>
- Date: Wed, 22 Nov 2006 15:58:33 +1300
On 22/11/06, Alastair Houghton <email@hidden> wrote:
Ah. You seem to misunderstand the term "condition variable". A
condition variable is a special type of synchronisation primitive,
which you can signal from one thread and wait on from another. It
doesn't mean a boolean flag variable that you test each time around a
loop.
That makes sense, thanks!
In Cocoa, you probably want to use NSConditionLock for this kind of
application. That way you don't have any busy waiting going on.
You'd do something like:
Does that mean that [myLock lockWhenCondition:0] yields if the lock is
not available (while it's checking)?
-Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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