Instance Method

tryLock

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

Declaration

- (BOOL)tryLock;

Return Value

YES if the lock could be acquired, NO otherwise.

Discussion

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.

- tryLockWhenCondition:

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

- unlockWithCondition:

Relinquishes the lock and sets the receiver’s condition.