Contents

tryLock(whenCondition:)

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

Declaration

func tryLock(whenCondition condition: Int) -> Bool

Return Value

true if the lock could be acquired, false otherwise.

Discussion

As part of its implementation, this method invokes lock(whenCondition:before:). This method returns immediately.

See Also

Acquiring and Releasing a Lock