Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 723830890bac44da3d113209b14e090b > files > 593

sbcl-1.0.31-1mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>Semaphores - SBCL 1.0.31 User Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="SBCL 1.0.31 User Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Threading.html#Threading" title="Threading">
<link rel="prev" href="Mutex-Support.html#Mutex-Support" title="Mutex Support">
<link rel="next" href="Waitqueue_002fcondition-variables.html#Waitqueue_002fcondition-variables" title="Waitqueue/condition variables">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--

     This manual is part of the SBCL software system. See the `README'
     file for more information.

     This manual is largely derived from the manual for the CMUCL
     system, which was produced at Carnegie Mellon University and later
     released into the public domain. This manual is in the public
     domain and is provided with absolutely no warranty. See the
     `COPYING' and `CREDITS' files for more information.
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Semaphores"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Waitqueue_002fcondition-variables.html#Waitqueue_002fcondition-variables">Waitqueue/condition variables</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Mutex-Support.html#Mutex-Support">Mutex Support</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Threading.html#Threading">Threading</a>
<hr>
</div>

<!-- node-name,  next,  previous,  up -->
<h3 class="section">12.4 Semaphores</h3>

<p>described here should be considered
experimental, subject to API changes without notice.

   <p><a name="Structure-sb_002dthread_003asemaphore"></a>

<div class="defun">
&mdash; Structure: <b>sb-thread:semaphore</b><var><a name="index-sb_002dthread_003asemaphore-479"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003asemaphore-480"></a>Class precedence list: <code>semaphore, structure-object, t</code>

        <p>Semaphore type. The fact that a <code>semaphore</code> is a <code>structure-object</code>
should be considered an implementation detail, and may change in the
future. 
</p></blockquote></div>

   <p><a name="Function-sb_002dthread_003amake_002dsemaphore"></a>

<div class="defun">
&mdash; Function: <b>sb-thread:make-semaphore</b><var> &amp;key name count<a name="index-sb_002dthread_003amake_002dsemaphore-481"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003amake_002dsemaphore-482"></a>Create a semaphore with the supplied <code>count</code> and <code>name</code>. 
</p></blockquote></div>

   <p><a name="Function-sb_002dthread_003asemaphore_002dcount"></a>

<div class="defun">
&mdash; Function: <b>sb-thread:semaphore-count</b><var> instance<a name="index-sb_002dthread_003asemaphore_002dcount-483"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003asemaphore_002dcount-484"></a>Returns the current count of the semaphore <code>instance</code>. 
</p></blockquote></div>

   <p><a name="Function-sb_002dthread_003asemaphore_002dname"></a>

<div class="defun">
&mdash; Function: <b>sb-thread:semaphore-name</b><var> instance<a name="index-sb_002dthread_003asemaphore_002dname-485"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003asemaphore_002dname-486"></a>Name of a <code>queue</code>. Can be assingned to using <code>setf</code>. Queue names
can be arbitrary printable objects, and need not be unique. 
</p></blockquote></div>

   <p><a name="Function-sb_002dthread_003asignal_002dsemaphore"></a>

<div class="defun">
&mdash; Function: <b>sb-thread:signal-semaphore</b><var> semaphore &amp;optional n<a name="index-sb_002dthread_003asignal_002dsemaphore-487"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003asignal_002dsemaphore-488"></a>Increment the count of <code>semaphore</code> by <code>n</code>. If there are threads waiting
on this semaphore, then <code>n</code> of them is woken up. 
</p></blockquote></div>

   <p><a name="Function-sb_002dthread_003await_002don_002dsemaphore"></a>

<div class="defun">
&mdash; Function: <b>sb-thread:wait-on-semaphore</b><var> semaphore<a name="index-sb_002dthread_003await_002don_002dsemaphore-489"></a></var><br>
<blockquote><p><a name="index-sb_002dthread_003await_002don_002dsemaphore-490"></a>Decrement the count of <code>semaphore</code> if the count would not be
negative. Else blocks until the semaphore can be decremented. 
</p></blockquote></div>

   </body></html>