libs-base/Documentation/gsdoc/NSLock.html
CaS 0a86bba7b0 Documentation regeneration and XML parsing fixes/updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9698 72102866-910b-0410-8b05-ffd578937521
2001-04-25 14:19:57 +00:00

62 lines
1.9 KiB
HTML

<html><head>
<title>NSLock</title>
</head>
<body>
<a href ="NSInvocation.html">[Previous] </a>
<a href ="Base.html">[Up] </a>
<a href ="NSMethodSignature.html">[Next] </a>
<h1>NSLock</h1>
<h3>Authors </h3>
<dl>
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Adam Fedor</a>
<dd>
</dl>
<p>Version: $Revision$</p>
<p>Date: $Date$</p>
<h2><a name ="cont-0">NSLock</a></h2>
<h2><a name ="NSLock">NSLock</a></h2>
<p><b>Declared in: </b> Foundation/NSLock.h</p>
<p><b>Inherits from: </b> NSObject</p>
<p><b>Conforms to: </b> NSLocking
</p>
<hr>
An NSLock 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 it's hold on the lock. The limitation of NSLock is that
you can only lock an
NSLock once and it must be unlocked before it can be aquired again.
Other lock classes, notably NSRecursiveLock, have
different restrictions.
<h2>Instance Variables </h2>
<ul>
</ul>
<h2>Methods </h2>
<ul>
<li ><a href ="NSLock.html#method-0">-lockBeforeDate:</a>
<li ><a href ="NSLock.html#method-1">-tryLock</a>
</ul>
<hr><h2>Instances Methods </h2>
<h3><a name ="method-0">lockBeforeDate:</a></h3>
- (BOOL) <b>lockBeforeDate:</b> (NSDate*)limit;<br>
Attempts to aquire a lock before the date limit passes. It returns YES
if it can. It returns NO if it cannot, or if the current thread already
has the lock (but it waits until the time limit is up before returning
NO).
<hr>
<h3><a name ="method-1">tryLock</a></h3>
- (BOOL) <b>tryLock</b>;<br>
Attempts to aquire a lock, but returns immediately if the lock
cannot be aquired. It returns YES if the lock is aquired. It returns
NO if the lock cannot be aquired or if the current thread already has
the lock.
<hr>
</body>
</html>