lock()
Attempts to acquire a lock.
Declaration
func lock()Discussion
This method blocks a thread’s execution until the lock can be acquired. 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 past, the thread relinquishes the lock by invoking unlock.
See Also
Deprecated instance methods
addPersistentStore(ofType:configurationName:at:options:)destroyPersistentStore(at:ofType:options:)importStore(withIdentifier:fromExternalRecordsDirectoryAt:to:options:ofType:)migratePersistentStore(_:to:options:withType:)replacePersistentStore(at:destinationOptions:withPersistentStoreFrom:sourceOptions:ofType:)tryLock()unlock()perform(_:)performAndWait(_:)