Re: NSCondition (unlocked when not locked)
Re: NSCondition (unlocked when not locked)
- Subject: Re: NSCondition (unlocked when not locked)
- From: Torsten Curdt <email@hidden>
- Date: Fri, 10 Jul 2009 18:29:55 +0200
Hey Ben
Thanks for quick response.
> What’s the value of SLEEP? -waitUntilDate: can return NO indicating that the
> timeout elapsed and the lock is not locked; you probably want -wait.
No, I do want the waitUntilDate because I do not solely want to wait
for the signal.
So you are saying it should rather be like this?
while (!quit) {
[pollingCondition lock];
if([pollingCondition waitUntilDate:
[NSDate dateWithTimeIntervalSinceNow:SLEEP]]) {
[pollingCondition unlock];
}
...
}
I can't seem to find that indicated in the documentation though.
http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/NSCondition_class/Reference/Reference.html
Also the documentation suggests that after calling
[pollingCondition lock];
the contract is to have a lock for sure.
cheers
--
Torsten
_______________________________________________
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