<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.syncreaderwriter.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'syncreaderwriter.construct.php',
    1 => 'SyncReaderWriter::__construct',
    2 => 'Constructs a new SyncReaderWriter object',
  ),
  'up' => 
  array (
    0 => 'class.syncreaderwriter.php',
    1 => 'SyncReaderWriter',
  ),
  'prev' => 
  array (
    0 => 'class.syncreaderwriter.php',
    1 => 'SyncReaderWriter',
  ),
  'next' => 
  array (
    0 => 'syncreaderwriter.readlock.php',
    1 => 'SyncReaderWriter::readlock',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sync/syncreaderwriter/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="syncreaderwriter.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SyncReaderWriter::__construct</h1>
  <p class="verinfo">(PECL sync &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">SyncReaderWriter::__construct</span> &mdash; <span class="dc-title">Constructs a new SyncReaderWriter object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-syncreaderwriter.construct-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SyncReaderWriter::__construct</strong></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">$autounlock</code><span class="initializer"> = 1</span></span>)</div>

  <p class="para rdfs-comment">
   Constructs a named or unnamed reader-writer object.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-syncreaderwriter.construct-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">name</code></dt>
    <dd>
     <p class="para">
      The name of the reader-writer if this is a named reader-writer object.
     </p>
     <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
      <p class="para">
       If the name already exists, it must be able to be opened by the current user
       that the process is running as or an exception will be thrown with a meaningless
       error message.
      </p>
     </p></blockquote>
     <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
      <span class="simpara">
       On Windows, <code class="parameter">name</code> must not contain backslashes.
      </span>
     </p></blockquote>
    </dd>
   
   
    <dt><code class="parameter">autounlock</code></dt>
    <dd>
     <p class="para">
      Specifies whether or not to automatically unlock the reader-writer at the
      conclusion of the PHP script.
     </p>
     <div class="warning"><strong class="warning">Увага</strong>
      <p class="para">
       If an object is:  A named reader-writer with an autounlock of FALSE, the
       object is locked for either reading or writing, and the PHP script concludes
       before the object is unlocked, then the underlying objects will end up in an
       inconsistent state.
      </p>
     </div>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-syncreaderwriter.construct-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   The new <span class="classname"><a href="class.syncreaderwriter.php" class="classname">SyncReaderWriter</a></span> object.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-syncreaderwriter.construct-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="para">
   An exception is thrown if the reader-writer cannot be created or opened.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-syncreaderwriter.construct-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="function"><strong>SyncReaderWriter::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$readwrite </span><span style="color: #007700">= new </span><span style="color: #0000BB">SyncReaderWriter</span><span style="color: #007700">(</span><span style="color: #DD0000">"FileCacheLock"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$readwrite</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">readlock</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">/* ... */<br /></span><span style="color: #0000BB">$readwrite</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">readunlock</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$readwrite</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writelock</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">/* ... */<br /></span><span style="color: #0000BB">$readwrite</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writeunlock</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-syncreaderwriter.construct-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="syncreaderwriter.readlock.php" class="methodname" rel="rdfs-seeAlso">SyncReaderWriter::readlock()</a> - Waits for a read lock</span></li>
   <li><span class="methodname"><a href="syncreaderwriter.readunlock.php" class="methodname" rel="rdfs-seeAlso">SyncReaderWriter::readunlock()</a> - Releases a read lock</span></li>
   <li><span class="methodname"><a href="syncreaderwriter.writelock.php" class="methodname" rel="rdfs-seeAlso">SyncReaderWriter::writelock()</a> - Waits for an exclusive write lock</span></li>
   <li><span class="methodname"><a href="syncreaderwriter.writeunlock.php" class="methodname" rel="rdfs-seeAlso">SyncReaderWriter::writeunlock()</a> - Releases a write lock</span></li>
  </ul>
 </div>


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