<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.sem-acquire.php',
    1 => 'sem_acquire',
    2 => 'Fordert Zugriff auf einen Semaphor an',
  ),
  'up' => 
  array (
    0 => 'ref.sem.php',
    1 => 'Semaphore Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.msg-stat-queue.php',
    1 => 'msg_stat_queue',
  ),
  'next' => 
  array (
    0 => 'function.sem-get.php',
    1 => 'sem_get',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/sem/functions/sem-acquire.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.sem-acquire" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sem_acquire</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">sem_acquire</span> &mdash; <span class="dc-title">Fordert Zugriff auf einen Semaphor an</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sem-acquire-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sem_acquire</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="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$non_blocking</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Standardmäßig blockiert <span class="function"><strong>sem_acquire()</strong></span> (falls nötig) bis
   ein Zugriff auf den Semaphor möglich ist. Ein Prozess, der Zugriff auf
   einen Semaphor anfordert, auf den er bereits Zugriff hat, wird für immer
   blockieren, wenn dieser erneute Zugriff die maximalen Zugriffe auf diesen
   Semaphor überschreiten würde.
  </p>
  <p class="simpara">
   Nach Abarbeitung einer Anfrage werden alle noch vom Prozess gehaltenen
   Semaphore automatisch freigegeben und entsprechende Warnungen erzeugt.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sem-acquire-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">semaphore</code></dt>
    <dd>
     <span class="simpara">
      <code class="parameter">semaphore</code> ist ein Semaphor, der von
      <span class="function"><a href="function.sem-get.php" class="function">sem_get()</a></span> zurückgegben wurde.
     </span>
    </dd>
   
   
    <dt><code class="parameter">non_blocking</code></dt>
    <dd>
     <span class="simpara">
      Gibt an, ob der Prozess nicht auf den Zugriff auf den Semaphor warten
      soll. Bei <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> wird der Aufruf unmittelbar <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgeben, wenn
      der Semaphor nicht sofort reserviert werden kann.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sem-acquire-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   Gibt bei Erfolg <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


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

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">semaphore</code> erwartet nun eine
       <span class="classname"><a href="class.sysvsemaphore.php" class="classname">SysvSemaphore</a></span>-Instanz; vorher wurde eine
       <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> erwartet.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.sem-acquire-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.sem-get.php" class="function" rel="rdfs-seeAlso">sem_get()</a> - Fordert Zugriff auf eine Semaphor-ID an</span></li>
   <li><span class="function"><a href="function.sem-release.php" class="function" rel="rdfs-seeAlso">sem_release()</a> - Gibt einen Semaphor frei</span></li>
  </ul>
 </div>


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