Re: Seeking advice on NSLock usage
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