Instance Method

tryLockWhenCondition:

Attempts to acquire a lock if the receiver’s condition is equal to the specified condition.

Declaration

- (BOOL)tryLockWhenCondition:(NSInteger)condition;

Return Value

YES if the lock could be acquired, NO otherwise.

Discussion

As part of its implementation, this method invokes lockWhenCondition:beforeDate:. This method returns immediately.

See Also

Acquiring and Releasing a Lock

- lockBeforeDate:

Attempts to acquire a lock before a specified moment in time.

- lockWhenCondition:

Attempts to acquire a lock.

- lockWhenCondition:beforeDate:

Attempts to acquire a lock before a specified moment in time.

- tryLock

Attempts to acquire a lock without regard to the receiver’s condition.

- unlockWithCondition:

Relinquishes the lock and sets the receiver’s condition.