May 2003
Intermediate to advanced
566 pages
27h 29m
English
NSConditionLock — Mac OS X 10.0
NSConditionLock is a class that implements the
NSLocking protocol and is used to perform
thread locks
that are associated with specific, user-defined conditions. The idea
behind NSConditionLock is that a thread can
acquire a lock only if some arbitrary condition has been satisfied.
See Chapter 2.
|
|
@interface NSConditionLock : NSObject <NSLocking>
|
// Initializers
|
- (id)initWithCondition:(int)condition; |
// Instance Methods
|
- (int)condition;
|
- (BOOL)lockBeforeDate:(NSDate *)limit; |
- (void)lockWhenCondition:(int)condition; |
- (BOOL)lockWhenCondition:(int)condition beforeDate:(NSDate *)limit; |
- (BOOL)tryLock;
|
- (BOOL)tryLockWhenCondition:(int)condition; |
- (void)unlockWithCondition:(int)condition; |
// Methods Implementing NSLocking
|
- (void)lock;
|
- (void)unlock;
|
Read now
Unlock full access