• 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: NSConditionLock console message: "unlocked from thread which did not lock it"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSConditionLock console message: "unlocked from thread which did not lock it"


  • Subject: Re: NSConditionLock console message: "unlocked from thread which did not lock it"
  • From: "stephen joseph butler" <email@hidden>
  • Date: Sun, 25 Nov 2007 12:23:12 -0600

On Nov 25, 2007 11:40 AM, Mark Alldritt <email@hidden> wrote:
> The message is correct: I lock the NSConditionLock from a worker thread to
> block the thread until another thread (the main thread) receives a response
> and the worker can continue on.
>
> This seems to me like a legitimate use of a lock.  Can anyone explain what
> the problem here is.

It is, but it doesn't sound like you're doing it correctly. Take a
close look at the section titled Using an NSConditionLock:

<file://localhost/Developer/ADC Reference Library/documentation/Cocoa/Conceptual/Multithreading/articles/CocoaLocks.html#//apple_ref/doc/uid/20000737>

NSConditionLock is, at its core, a mutual exclusion lock. The only
difference is that it allows a thread (the consumer) to intelligently
release the lock until a condition is satisfied, at which point it
re-acquires the lock and continues. The produced still has to ACQUIRE
the lock before it can change the condition.

Make sense?
_______________________________________________

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

  • Follow-Ups:
    • Re: NSConditionLock console message: "unlocked from thread which did not lock it"
      • From: "stephen joseph butler" <email@hidden>
References: 
 >NSConditionLock console message: "unlocked from thread which did not lock it" (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Re: How to get window title bar font ^size^ ?
  • Next by Date: Re: NSConditionLock console message: "unlocked from thread which did not lock it"
  • Previous by thread: NSConditionLock console message: "unlocked from thread which did not lock it"
  • Next by thread: Re: NSConditionLock console message: "unlocked from thread which did not lock it"
  • Index(es):
    • Date
    • Thread