summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/pthread_spin_lock.3 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man3/pthread_spin_lock.3 3.html')
-rw-r--r--static/freebsd/man3/pthread_spin_lock.3 3.html122
1 files changed, 122 insertions, 0 deletions
diff --git a/static/freebsd/man3/pthread_spin_lock.3 3.html b/static/freebsd/man3/pthread_spin_lock.3 3.html
new file mode 100644
index 00000000..1babc686
--- /dev/null
+++ b/static/freebsd/man3/pthread_spin_lock.3 3.html
@@ -0,0 +1,122 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">PTHREAD_SPIN_LOCK(3)</td>
+ <td class="head-vol">Library Functions Manual</td>
+ <td class="head-rtitle">PTHREAD_SPIN_LOCK(3)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">pthread_spin_lock</code>,
+ <code class="Nm">pthread_spin_trylock</code>,
+ <code class="Nm">pthread_spin_unlock</code> &#x2014; <span class="Nd">lock
+ or unlock a spin lock</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
+<p class="Pp"><span class="Lb">POSIX Threads Library (libpthread,
+ -lpthread)</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp"><code class="In">#include
+ &lt;<a class="In">pthread.h</a>&gt;</code></p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_spin_lock</code>(<var class="Fa" style="white-space: nowrap;">pthread_spinlock_t
+ *lock</var>);</p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_spin_trylock</code>(<var class="Fa" style="white-space: nowrap;">pthread_spinlock_t
+ *lock</var>);</p>
+<p class="Pp"><var class="Ft">int</var>
+ <br/>
+ <code class="Fn">pthread_spin_unlock</code>(<var class="Fa" style="white-space: nowrap;">pthread_spinlock_t
+ *lock</var>);</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The
+ <a class="permalink" href="#pthread_spin_lock"><code class="Fn" id="pthread_spin_lock">pthread_spin_lock</code></a>()
+ function will acquire <var class="Fa">lock</var> if it is not currently
+ owned by another thread. If the lock cannot be acquired immediately, it will
+ spin attempting to acquire the lock (it will not sleep) until it becomes
+ available.</p>
+<p class="Pp" id="pthread_spin_trylock">The
+ <a class="permalink" href="#pthread_spin_trylock"><code class="Fn">pthread_spin_trylock</code></a>()
+ function is the same as <code class="Fn">pthread_spin_lock</code>() except
+ that if it cannot acquire <var class="Fa">lock</var> immediately it will
+ return with an error.</p>
+<p class="Pp" id="pthread_spin_unlock">The
+ <a class="permalink" href="#pthread_spin_unlock"><code class="Fn">pthread_spin_unlock</code></a>()
+ function will release <var class="Fa">lock</var>, which must have been
+ previously locked by a call to <code class="Fn">pthread_spin_lock</code>()
+ or <code class="Fn">pthread_spin_trylock</code>().</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
+ VALUES</a></h1>
+<p class="Pp">If successful, all these functions will return zero. Otherwise, an
+ error number will be returned to indicate the error.</p>
+<p class="Pp">None of these functions will return
+ <code class="Er">EINTR</code>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
+<p class="Pp">The <code class="Fn">pthread_spin_lock</code>(),
+ <code class="Fn">pthread_spin_trylock</code>() and
+ <code class="Fn">pthread_spin_unlock</code>() functions will fail if:</p>
+<dl class="Bl-tag">
+ <dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt>
+ <dd>The value specified by <var class="Fa">lock</var> is invalid or is not
+ initialized.</dd>
+</dl>
+<p class="Pp">The <code class="Fn">pthread_spin_lock</code>() function may fail
+ if:</p>
+<dl class="Bl-tag">
+ <dt id="EDEADLK">[<a class="permalink" href="#EDEADLK"><code class="Er">EDEADLK</code></a>]</dt>
+ <dd>The calling thread already owns the lock.</dd>
+</dl>
+<p class="Pp">The <code class="Fn">pthread_spin_trylock</code>() function will
+ fail if:</p>
+<dl class="Bl-tag">
+ <dt id="EBUSY">[<a class="permalink" href="#EBUSY"><code class="Er">EBUSY</code></a>]</dt>
+ <dd>Another thread currently holds <var class="Fa">lock</var>.</dd>
+</dl>
+<p class="Pp">The <code class="Fn">pthread_spin_unlock</code>() function may
+ fail if:</p>
+<dl class="Bl-tag">
+ <dt id="EPERM">[<a class="permalink" href="#EPERM"><code class="Er">EPERM</code></a>]</dt>
+ <dd>The calling thread does not own <var class="Fa">lock</var>.</dd>
+</dl>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">pthread_spin_destroy(3)</a>,
+ <a class="Xr">pthread_spin_init(3)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
+<p class="Pp">The <code class="Fn">pthread_spin_lock</code>(),
+ <code class="Fn">pthread_spin_trylock</code>() and
+ <code class="Fn">pthread_spin_unlock</code>() functions first appeared in
+ <span class="Lb">N:M Threading Library (libkse, -lkse)</span> in
+ <span class="Ux">FreeBSD 5.2</span>, and in <span class="Lb">1:1 Threading
+ Library (libthr, -lthr)</span> in <span class="Ux">FreeBSD 5.3</span>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
+<p class="Pp">The implementation of <code class="Fn">pthread_spin_lock</code>(),
+ <code class="Fn">pthread_spin_trylock</code>() and
+ <code class="Fn">pthread_spin_unlock</code>() is expected to conform to
+ <span class="St">IEEE Std 1003.2 (&#x201C;POSIX.2&#x201D;)</span>.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">January 22, 2004</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>