• 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: Seeking advice on NSLock usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seeking advice on NSLock usage


  • Subject: Re: Seeking advice on NSLock usage
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 12 Dec 2004 10:48:23 -0700


On Dec 12, 2004, at 8:36 AM, Jeremy Dronfield wrote:

1. How do locks work?

Locks work by making it so that if a -lock message is sent to a lock that is already locked, then the thread will freeze until whatever obtained the lock in the first place unlocks the lock. Then the other thread will unfreeze and it will obtain the lock, and anything else that attempts to acquire the lock will freeze until the lock is unlocked, and so on...


2. It appears that NSLock can't be used with non-object variables. Some of my search criteria are strings, but most are BOOLs and ints. How can I lock those?

You can put _anything_ under the protection of an NSLock, not just Foundation objects.


Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Seeking advice on NSLock usage (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Cocoa HTML Decoder
  • Next by Date: Re: Displaying an NSArray of NSArray's in a Table view
  • Previous by thread: Seeking advice on NSLock usage
  • Next by thread: Re: Seeking advice on NSLock usage
  • Index(es):
    • Date
    • Thread