• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCondition (unlocked when not locked)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Window Resize with Animator Proxy: Window Contents Jump Around
  • Next by Date: Initialising NSMutableArray
  • Previous by thread: Re: NSCondition (unlocked when not locked)
  • Next by thread: How to write ipeg image created with CGImageRef?
  • Index(es):
    • Date
    • Thread