NSConditionLock class defines objects whose locks can be associated with specific, user-defined conditions. Using an
NSConditionLock object, you can ensure that a thread can acquire a lock only if a certain condition is met. Once it has acquired the lock and executed the critical section of code, the thread can relinquish the lock and set the associated condition to something new. The conditions themselves are arbitrary: you define them as needed for your application.
- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
- watchOS 2.0+