Contents

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 the lock was acquired, otherwise false.

See Also

Acquiring a Lock