This is NSLock.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s8 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSLock pard s21 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject fs20 fs28 s12 f0 b fs24 Conforms To:tab b0 fs28 f1 NSLocking fi0 NSObject (NSObject) fs20 fs28 s13 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSLock.h fs20 fs28 pard s35 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s2 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 An NSLock is used to protect critical regions of code. A lock is created once and is subsequently used to protect one or more regions of code. If a region of code is in use, an NSLock waits using the b condition_wait()b0 function, so the thread doesn'27t busy-wait. The following example shows the use of an NSLock with the methods b lockb0 and b unlockb0 defined in the NSLocking protocol: fs16 fs28 pard s10 li1231 fi0 ri1007 ql f2 fs20 NSLock *theLock = [NSLock new]; // done once! /* ... other code */ fi0 [theLock lock]; fi0 /* ... possibly a long time of fussing with global data... */ fi0 [theLock unlock]; pard s2 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 fs28 fs16 fs28 The NSConditionLock, NSLock, and NSRecursiveLock classes all implement the NSLocking protocol with various features and performance characteristics; see the other class descriptions for more information. fs16 fs28 pard s35 li100 fi0 ri1007 ql f0 b fs24 fs28 Acquiring a Lock fs14 fs28 pard s14 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (BOOL)b tryLockb0 tab Attempts to acquire a lock. Returns YES if successful and NO otherwise. Returns immediately. }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.