Name

NSLock — Mac OS X 10.0

Synopsis

NSLock implements thread locks that can be used to let multiple threads in an application access the same data without clashing. The use of NSLock, and locking in general, is discussed in detail in Chapter 2.

image with no caption

@interface NSLock : NSObject <NSLocking>
                                  // Instance Methods
   - (BOOL)lockBeforeDate:(NSDate *)limit;
   - (BOOL)tryLock;
                                  // Methods Implementing NSLocking
   - (void)lock;
   - (void)unlock;

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.