<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.sync.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.syncsemaphore.php',
    1 => 'SyncSemaphore',
    2 => 'The SyncSemaphore class',
  ),
  'up' => 
  array (
    0 => 'book.sync.php',
    1 => 'Sync',
  ),
  'prev' => 
  array (
    0 => 'syncmutex.unlock.php',
    1 => 'SyncMutex::unlock',
  ),
  'next' => 
  array (
    0 => 'syncsemaphore.construct.php',
    1 => 'SyncSemaphore::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sync/syncsemaphore.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.syncsemaphore.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.syncsemaphore" class="reference">

 <h1 class="title">The SyncSemaphore class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL sync &gt;= 1.0.0)</p>


  <div class="section" id="syncsemaphore.intro">
   <h2 class="title">Introduction</h2>
   <p class="simpara">
    A cross-platform, native implementation of named and unnamed semaphore objects.
   </p>
   <p class="simpara">
    A semaphore restricts access to a limited resource to a limited number of instances.
    Semaphores differ from mutexes in that they can allow more than one instance to
    access a resource at one time while a mutex only allows one instance at a time.
   </p>
  </div>


  <div class="section" id="syncsemaphore.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <span class="ooclass"><strong class="classname"></strong></span>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">SyncSemaphore</strong>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="syncsemaphore.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$initialval</code><span class="initializer"> = 1</span></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$autounlock</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></span></span>)</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="syncsemaphore.lock.php" class="methodname">lock</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$wait</code><span class="initializer"> = -1</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="syncsemaphore.unlock.php" class="methodname">unlock</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$prevcount</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

   }</div>


  </div>

 </div>

 















<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="syncsemaphore.construct.php">SyncSemaphore::__construct</a> — Constructs a new SyncSemaphore object</li><li><a href="syncsemaphore.lock.php">SyncSemaphore::lock</a> — Decreases the count of the semaphore or waits</li><li><a href="syncsemaphore.unlock.php">SyncSemaphore::unlock</a> — Increases the count of the semaphore</li></ul>
</div>
<?php manual_footer($setup); ?>