# NSLock+GNUstepBase documentation

rfm@gnu.org
2003-2010 Free Software Foundation, Inc.
Software documentation for the NSLock(GNUstepBase) category
GNUstepBase/NSLock+GNUstepBase.h
Description forthcoming.
newLockAt:
location
Initializes the id pointed to by location with a new instance of the receiver's class in a thread safe manner, unless it has been previously initialized. Returns the contents pointed to by location. The location is considered unintialized if it contains `nil`.
This method is used in the GS_INITIALIZED_LOCK macro to initialize lock variables when it cannot be insured that they can be initialized in a thread safe environment. NSLock *my_lock = nil; void function (void) { [GS_INITIALIZED_LOCK(my_lock, NSLock) lock]; do_work (); [my_lock unlock]; }
Software documentation for the NSRecursiveLock(GNUstepBase) category
GNUstepBase/NSLock+GNUstepBase.h
Description forthcoming.
newLockAt:
location
Initializes the id pointed to by location with a new instance of the receiver's class in a thread safe manner, unless it has been previously initialized. Returns the contents pointed to by location. The location is considered unintialized if it contains `nil`.
This method is used in the GS_INITIALIZED_LOCK macro to initialize lock variables when it cannot be insured that they can be initialized in a thread safe environment. NSLock *my_lock = nil; void function (void) { [GS_INITIALIZED_LOCK(my_lock, NSLock) lock]; do_work (); [my_lock unlock]; }