The abstract lock.
inherits
State supers: State
methods
deferred void
lock;
|
Undocumented.
deferred void
unlock;
|
Undocumented.
deferred boolean
tryLock;
|
Try to lock, and return YES if it succeeded.
Any (result) doWhileLocked Block block; |
Lock, execute the block, and guarantee to unlock.
A simple lock is a binary lock.
inherits
State supers: Lock
variables
The underlying lock.
methods
void
dealloc;
|
Undocumented.
id
init;
|
Designated initializer.
void
lock;
|
Undocumented.
void
unlock;
|
Undocumented.
boolean
tryLock;
|
Undocumented.
A recursive lock is a binary lock which can be obtained multiple times by the same thread.
inherits
State supers: Lock
variables
The underlying lock.
methods
void
dealloc;
|
Undocumented.
id
init;
|
Designated initializer.
void
lock;
|
Undocumented.
void
unlock;
|
Undocumented.
boolean
tryLock;
|
Undocumented.
A semaphore is a lock which can be locked a number of times (1 for a binary semaphore) before the next attempt to lock will block.
When allocated first, the first lock will block.
inherits
State supers: Lock
methods
instance (id) new int num; |
Return a new Semaphore, the first num lock operations will succeed.
variables
Pointer to the underlying structure.
methods
void
dealloc;
|
Undocumented.
id init int num; |
Designated initializer.
id
init;
|
Another initializer.
void
lock;
|
Undocumented.
void
unlock;
|
Undocumented.
boolean
tryLock;
|
Undocumented.