Re: NSCondition (unlocked when not locked)
Re: NSCondition (unlocked when not locked)
- Subject: Re: NSCondition (unlocked when not locked)
- From: Greg Guerin <email@hidden>
- Date: Mon, 13 Jul 2009 07:06:59 -0700
Torsten Curdt wrote:
Hm ... but if I surround my task's work with lock/unlock wouldn't this
block the calling thread until the worker thread has done it's work?
Follow the existing example from "Threading Programming Guide", under
the "Using Conditions" section. It's simple and clear. If it
doesn't work, then post again.
If it works but you don't understand why, then that would be another
reason to post again. But if you don't follow the existing advice
that's documented as working correctly, speculating about other
approaches is simply wasted effort.
You might also look at the NSLock or NSConditionLock class, as they
may be closer to what you're trying to do. And again, follow the
examples in "Threading Programming Guide".
-- GG
_______________________________________________
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