![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSLock class reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSLock">NSLock class reference</a></h1> <h3>Authors</h3> <dl> <dt>David Chisnall (<a href="mailto:csdavec@swan.ac.uk"><code>csdavec@swan.ac.uk</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 1996-2010 Free Software Foundation, Inc.</p> <div> <hr width="50%" align="left" /> <h3>Contents -</h3> <ol> <li> <a href="#001000000000">Software documentation for the NSCondition class</a> </li> <li> <a href="#002000000000">Software documentation for the NSConditionLock class</a> </li> <li> <a href="#003000000000">Software documentation for the NSLock class</a> </li> <li> <a href="#004000000000">Software documentation for the NSRecursiveLock class</a> </li> <li> <a href="#005000000000">Software documentation for the NSObject(GSTraceLocks) informal protocol</a> </li> <li> <a href="#006000000000">Software documentation for the NSLocking protocol</a> </li> </ol> <hr width="50%" align="left" /> </div> <h1><a name="001000000000"> Software documentation for the NSCondition class </a></h1> <h2><a name="class$NSCondition">NSCondition</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="#protocol$(NSLocking)">NSLocking</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> NSCondition provides an interface to POSIX condition variables. </div> <hr width="50%" align="left" /> <a href="#_NSCondition_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-broadcast">-broadcast</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-name">-name</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-setName$">-setName:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-signal">-signal</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-wait">-wait</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSCondition-waitUntilDate$">-waitUntilDate:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSCondition-broadcast">broadcast </a></h3> - (void) <b>broadcast</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Wakes all threads that are waiting on this condition. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCondition-name">name </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>name</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the name used for debugging messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCondition-setName$">setName: </a></h3> - (void) <b>setName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)newName;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets the name used for debugging messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCondition-signal">signal </a></h3> - (void) <b>signal</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Wakes wany one of the threads that are waiting on this condition. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCondition-wait">wait </a></h3> - (void) <b>wait</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Blocks and atomically unlocks the receiver. This method should only be called when the receiver is locked. The caller will then block until the receiver is sent either a <a rel="gsdoc" href="#method$NSCondition-signal"> -signal </a> or <a rel="gsdoc" href="#method$NSCondition-broadcast">-broadcast</a> message from another thread. At which point, the calling thread will reacquire the lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCondition-waitUntilDate$">waitUntilDate: </a></h3> - (BOOL) <b>waitUntilDate:</b> (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*)limit;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Blocks the calling thread and acquires the lock, in the same way as <a rel="gsdoc" href="#method$NSCondition-wait"> -wait </a> . Returns <code>YES</code> if the condition is signaled, or <code>NO</code> if the timeout is reached. </div> <hr width="25%" align="left" /> </div> <a name="_NSCondition_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSCondition Class</h2> <h3><a name="ivariable$NSCondition*_condition">_condition</a></h3> @protected gs_cond_t <b>_condition</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSCondition*_mutex">_mutex</a></h3> @protected gs_mutex_t <b>_mutex</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSCondition*_name">_name</a></h3> @protected NSString* <b>_name</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <br/><hr width="50%" align="left" /><br/> <h1><a name="002000000000"> Software documentation for the NSConditionLock class </a></h1> <h2><a name="class$NSConditionLock">NSConditionLock</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="#protocol$(NSLocking)">NSLocking</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Lock that allows user to request it only when an internal integer condition is equal to a particular value. The condition is set on initialization and whenever the lock is relinquished. </div> <hr width="50%" align="left" /> <a href="#_NSConditionLock_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-condition">-condition</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-initWithCondition$">-initWithCondition:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-isLockedByCurrentThread">-isLockedByCurrentThread</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-lock">-lock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-lockBeforeDate$">-lockBeforeDate:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-lockWhenCondition$">-lockWhenCondition:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-lockWhenCondition$beforeDate$">-lockWhenCondition:beforeDate:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-name">-name</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-setName$">-setName:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-tryLock">-tryLock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-tryLockWhenCondition$">-tryLockWhenCondition:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-unlock">-unlock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSConditionLock-unlockWithCondition$">-unlockWithCondition:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSConditionLock-condition">condition </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>) <b>condition</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return the current condition of the lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-initWithCondition$">initWithCondition: </a></h3> - (id) <b>initWithCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)value;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialize lock with given condition. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-isLockedByCurrentThread">isLockedByCurrentThread </a></h3> - (BOOL) <b>isLockedByCurrentThread</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Report whether this lock is held by the current thread. <br /> Raises an exception if this is not supported by the system lock mechanism. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-lock">lock </a></h3> - (void) <b>lock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Block until acquiring lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-lockBeforeDate$">lockBeforeDate: </a></h3> - (BOOL) <b>lockBeforeDate:</b> (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*)limit;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock and return before <var>limit</var>, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-lockWhenCondition$">lockWhenCondition: </a></h3> - (void) <b>lockWhenCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)value;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Acquire lock when it is available and the internal condition is equal to <var>value</var>. Blocks until this occurs. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-lockWhenCondition$beforeDate$">lockWhenCondition: beforeDate: </a></h3> - (BOOL) <b>lockWhenCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)condition_to_meet<b> beforeDate:</b> (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*)limitDate;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock, when internal condition is equal to <var>condition_to_meet</var>, and return before limit, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-name">name </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>name</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return the name of the receiver or <code>nil</code> of none has been set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-setName$">setName: </a></h3> - (void) <b>setName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Sets the <var>name</var> of the receiver (for use in debugging). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-tryLock">tryLock </a></h3> - (BOOL) <b>tryLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock regardless of condition and return immediately, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-tryLockWhenCondition$">tryLockWhenCondition: </a></h3> - (BOOL) <b>tryLockWhenCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)value;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock if condition is equal to <var>value</var> and return immediately in any case, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-unlock">unlock </a></h3> - (void) <b>unlock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Relinquish lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConditionLock-unlockWithCondition$">unlockWithCondition: </a></h3> - (void) <b>unlockWithCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)value;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Relinquish the lock, setting internal condition to <var>value</var>. </div> <hr width="25%" align="left" /> </div> <a name="_NSConditionLock_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSConditionLock Class</h2> <h3><a name="ivariable$NSConditionLock*_condition">_condition</a></h3> @protected NSCondition* <b>_condition</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSConditionLock*_condition_value">_condition_value</a></h3> @protected int <b>_condition_value</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSConditionLock*_name">_name</a></h3> @protected NSString* <b>_name</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <br/><hr width="50%" align="left" /><br/> <h1><a name="003000000000"> Software documentation for the NSLock class </a></h1> <h2><a name="class$NSLock">NSLock</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="#protocol$(NSLocking)">NSLocking</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> Simplest lock for protecting critical sections of code. </p> <p> </p> <p> An <code>NSLock</code> is used in multi-threaded applications to protect critical pieces of code. While one thread holds a lock within a piece of code, another thread cannot execute that code until the first thread has given up its hold on the lock. The limitation of <code>NSLock</code> is that you can only lock an <code>NSLock</code> once and it must be unlocked before it can be acquired again. <br /> Other lock classes, notably <a rel="gsdoc" href="#class$NSRecursiveLock">NSRecursiveLock</a> , have different restrictions. </p> <p> </div> <hr width="50%" align="left" /> <a href="#_NSLock_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-isLockedByCurrentThread">-isLockedByCurrentThread</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-lock">-lock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-lockBeforeDate$">-lockBeforeDate:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-name">-name</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-setName$">-setName:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-tryLock">-tryLock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSLock-unlock">-unlock</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSLock-isLockedByCurrentThread">isLockedByCurrentThread </a></h3> - (BOOL) <b>isLockedByCurrentThread</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Report whether this lock is held by the current thread. <br /> Raises an exception if this is not supported by the system lock mechanism. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-lock">lock </a></h3> - (void) <b>lock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Block until acquiring lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-lockBeforeDate$">lockBeforeDate: </a></h3> - (BOOL) <b>lockBeforeDate:</b> (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*)limit;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock and return before <var>limit</var>, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-name">name </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>name</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return the name of the receiver or <code>nil</code> of none has been set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-setName$">setName: </a></h3> - (void) <b>setName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Sets the <var>name</var> of the receiver (for use in debugging). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-tryLock">tryLock </a></h3> - (BOOL) <b>tryLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock and return immediately, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSLock-unlock">unlock </a></h3> - (void) <b>unlock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Relinquish lock. </div> <hr width="25%" align="left" /> </div> <a name="_NSLock_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSLock Class</h2> <h3><a name="ivariable$NSLock*_mutex">_mutex</a></h3> @protected gs_mutex_t <b>_mutex</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSLock*_name">_name</a></h3> @protected NSString* <b>_name</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <br/><hr width="50%" align="left" /><br/> <h1><a name="004000000000"> Software documentation for the NSRecursiveLock class </a></h1> <h2><a name="class$NSRecursiveLock">NSRecursiveLock</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="#protocol$(NSLocking)">NSLocking</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Allows the lock to be recursively acquired by the same thread. If the same thread locks the mutex (n) times then that same thread must also unlock it (n) times before another thread can acquire the lock. </div> <hr width="50%" align="left" /> <a href="#_NSRecursiveLock_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-isLockedByCurrentThread">-isLockedByCurrentThread</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-lock">-lock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-lockBeforeDate$">-lockBeforeDate:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-name">-name</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-setName$">-setName:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-tryLock">-tryLock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSRecursiveLock-unlock">-unlock</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSRecursiveLock-isLockedByCurrentThread">isLockedByCurrentThread </a></h3> - (BOOL) <b>isLockedByCurrentThread</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Report whether this lock is held by the current thread. <br /> Raises an exception if this is not supported by the system lock mechanism. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-lock">lock </a></h3> - (void) <b>lock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Block until acquiring lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-lockBeforeDate$">lockBeforeDate: </a></h3> - (BOOL) <b>lockBeforeDate:</b> (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*)limit;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock and return before <var>limit</var>, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-name">name </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>name</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return the name of the receiver or <code>nil</code> of none has been set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-setName$">setName: </a></h3> - (void) <b>setName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Sets the <var>name</var> of the receiver (for use in debugging). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-tryLock">tryLock </a></h3> - (BOOL) <b>tryLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Try to acquire lock regardless of condition and return immediately, <code>YES</code> if succeeded, <code>NO</code> if not. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSRecursiveLock-unlock">unlock </a></h3> - (void) <b>unlock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Relinquish lock. </div> <hr width="25%" align="left" /> </div> <a name="_NSRecursiveLock_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSRecursiveLock Class</h2> <h3><a name="ivariable$NSRecursiveLock*_mutex">_mutex</a></h3> @protected gs_mutex_t <b>_mutex</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <h3><a name="ivariable$NSRecursiveLock*_name">_name</a></h3> @protected NSString* <b>_name</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <br/><hr width="50%" align="left" /><br/> <h1><a name="005000000000"> Software documentation for the NSObject(GSTraceLocks) informal protocol </a></h1> <h2><a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a>(<a name="category$NSObject(GSTraceLocks)">GSTraceLocks</a>)</h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Controls tracing of locks for deadlocking. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$NSObject(GSTraceLocks)+shouldCreateTraceableLocks$">+shouldCreateTraceableLocks:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSObject(GSTraceLocks)+tracedCondition">+tracedCondition</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSObject(GSTraceLocks)+tracedConditionLockWithCondition$">+tracedConditionLockWithCondition:</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSObject(GSTraceLocks)+tracedLock">+tracedLock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$NSObject(GSTraceLocks)+tracedRecursiveLock">+tracedRecursiveLock</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSObject(GSTraceLocks)+shouldCreateTraceableLocks$">shouldCreateTraceableLocks: </a></h3> + (BOOL) <b>shouldCreateTraceableLocks:</b> (BOOL)shouldTrace;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets whether newly created lock objects (NSCondition, NSConditionLock, NSLock, NSRecursiveLock but NOT NSDistributedLock) should be created so that their use by threads is traced and deadlocks can be detected. <br /> Returns the old value of the setting. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(GSTraceLocks)+tracedCondition">tracedCondition </a></h3> + (<a rel="gsdoc" href="#class$NSCondition">NSCondition</a>*) <b>tracedCondition</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Creates and returns a single autoreleased traced condition. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(GSTraceLocks)+tracedConditionLockWithCondition$">tracedConditionLockWithCondition: </a></h3> + (<a rel="gsdoc" href="#class$NSConditionLock">NSConditionLock</a>*) <b>tracedConditionLockWithCondition:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)value;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Creates and returns a single autoreleased traced condition lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(GSTraceLocks)+tracedLock">tracedLock </a></h3> + (<a rel="gsdoc" href="#class$NSLock">NSLock</a>*) <b>tracedLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Creates and returns a single autoreleased traced lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(GSTraceLocks)+tracedRecursiveLock">tracedRecursiveLock </a></h3> + (<a rel="gsdoc" href="#class$NSRecursiveLock">NSRecursiveLock</a>*) <b>tracedRecursiveLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Creates and returns a single autoreleased traced recursive lock. </div> <hr width="25%" align="left" /> </div> <h1><a name="006000000000"> Software documentation for the NSLocking protocol </a></h1> <h2><a name="protocol$(NSLocking)">NSLocking</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSLock.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Protocol defining lock and unlock operations. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSLock.html#method$(NSLocking)-lock">-lock</a></li> <li><a rel="gsdoc" href="NSLock.html#method$(NSLocking)-unlock">-unlock</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$(NSLocking)-lock">lock </a></h3> - (void) <b>lock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Block until acquiring lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$(NSLocking)-unlock">unlock </a></h3> - (void) <b>unlock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Relinquish lock. </div> <hr width="25%" align="left" /> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>