<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.sem-release.php',
    1 => 'sem_release',
    2 => 'Release a semaphore',
  ),
  'up' => 
  array (
    0 => 'ref.sem.php',
    1 => 'Semaphore Functions',
  ),
  'prev' => 
  array (
    0 => 'function.sem-get.php',
    1 => 'sem_get',
  ),
  'next' => 
  array (
    0 => 'function.sem-remove.php',
    1 => 'sem_remove',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sem/functions/sem-release.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.sem-release" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sem_release</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">sem_release</span> &mdash; <span class="dc-title">Release a semaphore</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sem-release-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sem_release</strong></span>(<span class="methodparam"><span class="type"><a href="class.sysvsemaphore.php" class="type SysvSemaphore">SysvSemaphore</a></span> <code class="parameter">$semaphore</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   <span class="function"><strong>sem_release()</strong></span> releases the semaphore if it
   is currently acquired by the calling process, otherwise
   a warning is generated.
  </p>
  <p class="simpara">
   After releasing the semaphore, <span class="function"><a href="function.sem-acquire.php" class="function">sem_acquire()</a></span>
   may be called to re-acquire it.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sem-release-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">semaphore</code></dt>
    <dd>
     <span class="simpara">
      A Semaphore as returned by
      <span class="function"><a href="function.sem-get.php" class="function">sem_get()</a></span>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sem-release-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.sem-release-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">semaphore</code> expects a <span class="classname"><a href="class.sysvsemaphore.php" class="classname">SysvSemaphore</a></span>
       instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.sem-release-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.sem-get.php" class="function" rel="rdfs-seeAlso">sem_get()</a> - Get a semaphore id</span></li>
   <li><span class="function"><a href="function.sem-acquire.php" class="function" rel="rdfs-seeAlso">sem_acquire()</a> - Acquire a semaphore</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>