lockIfAvailable() Attempts to acquire a lock. Declarationfunc lockIfAvailable() -> Bool Return Valuetrue if successful; otherwise, false. See AlsoUsing lockslock()unlock()