![]() 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>NSDistributedLock class reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSDistributedLock">NSDistributedLock class reference</a></h1> <h3>Authors</h3> <dl> <dt>Richard Frith-Macdonald (<a href="mailto:richard@brainstorm.co.uk"><code>richard@brainstorm.co.uk</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 1997 Free Software Foundation, Inc.</p> <div> </div> <h1><a name="001000000000"> Software documentation for the NSDistributedLock class </a></h1> <h2><a name="class$NSDistributedLock">NSDistributedLock</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSDistributedLock.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> This class does not adopt the <a rel="gsdoc" href="NSLock.html#protocol$(NSLocking)"><NSLocking></a> protocol but supports locking across processes, including processes on different machines, as <strong>long</strong> as they can access a common filesystem. </div> <hr width="50%" align="left" /> <a href="#_NSDistributedLock_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock+lockWithPath$">+lockWithPath:</a></li> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock-breakLock">-breakLock</a></li> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock-initWithPath$">-initWithPath:</a></li> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock-lockDate">-lockDate</a></li> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock-tryLock">-tryLock</a></li> <li><a rel="gsdoc" href="NSDistributedLock.html#method$NSDistributedLock-unlock">-unlock</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSDistributedLock+lockWithPath$">lockWithPath: </a></h3> + (<a rel="gsdoc" href="#class$NSDistributedLock">NSDistributedLock</a>*) <b>lockWithPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aPath;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return a distributed lock for <var>aPath</var>. See <a rel="gsdoc" href="#method$NSDistributedLock-initWithPath$"> -initWithPath: </a> for details. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSDistributedLock-breakLock">breakLock </a></h3> - (void) <b>breakLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Forces release of the lock whether the receiver owns it or not. <br /> Raises an NSGenericException if unable to remove the lock. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSDistributedLock-initWithPath$">initWithPath: </a></h3> - (id) <b>initWithPath:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aPath;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialises the receiver with the specified filesystem path. <br /> The location in the filesystem must be accessible for this to be usable. That is, the processes using the lock must be able to access, create, and destroy files at the path. <br /> The directory in which the last path component resides must already exist... create it using NSFileManager if you need to. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSDistributedLock-lockDate">lockDate </a></h3> - (<a rel="gsdoc" href="NSDate.html#class$NSDate">NSDate</a>*) <b>lockDate</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the date at which the lock was acquired by <em>any</em> NSDistributedLock using the same path. If nothing has the lock, this returns <code>nil</code> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSDistributedLock-tryLock">tryLock </a></h3> - (BOOL) <b>tryLock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Attempt to acquire the lock and return <code>YES</code> on success, <code>NO</code> on failure. <br /> May raise an NSGenericException if a problem occurs. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSDistributedLock-unlock">unlock </a></h3> - (void) <b>unlock</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Releases the lock. Raises an NSGenericException if unable to release the lock (for instance if the receiver does not own it or another process has broken it). </div> <hr width="25%" align="left" /> </div> <a name="_NSDistributedLock_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSDistributedLock Class</h2> <h3><a name="ivariable$NSDistributedLock*_localLock">_localLock</a></h3> @protected NSLock* <b>_localLock</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$NSDistributedLock*_lockPath">_lockPath</a></h3> @protected NSString* <b>_lockPath</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$NSDistributedLock*_lockTime">_lockTime</a></h3> @protected NSDate* <b>_lockTime</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/> <br /> <a href="Base.html">Up</a> </font> </body> </html>