Attempts to acquire a lock, blocking a thread’s execution until the lock can be acquired.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
An application protects a critical section of code by requiring a thread to acquire a lock before executing the code. Once the critical section is completed, the thread relinquishes the lock by invoking