Instance Method

try()

Attempts to acquire a lock, and immediately returns a Boolean value that indicates whether the attempt was successful.

Declaration

func `try`() -> Bool

Return Value

true if successful, otherwise false.

See Also

Acquiring a Lock

func lock(before: Date) -> Bool

Attempts to acquire a lock before a given date.