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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]