<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.swoole-atomic.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'swoole-atomic.construct.php',
    1 => 'Swoole\\Atomic::__construct',
    2 => 'Construct a swoole atomic object.',
  ),
  'up' => 
  array (
    0 => 'class.swoole-atomic.php',
    1 => 'Swoole\\Atomic',
  ),
  'prev' => 
  array (
    0 => 'swoole-atomic.cmpset.php',
    1 => 'Swoole\\Atomic::cmpset',
  ),
  'next' => 
  array (
    0 => 'swoole-atomic.get.php',
    1 => 'Swoole\\Atomic::get',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/swoole/swoole/atomic/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="swoole-atomic.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Swoole\Atomic::__construct</h1>
  <p class="verinfo">(PECL swoole &gt;= 1.9.0)</p><p class="refpurpose"><span class="refname">Swoole\Atomic::__construct</span> &mdash; <span class="dc-title">Construct a swoole atomic object.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-swoole-atomic.construct-description">
  <h3 class="title">Descrizione</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Swoole\Atomic::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$value</code><span class="initializer"> = ?</span></span>)</div>

  <p class="para rdfs-comment">
    Swoole atomic object is an integer variable allows any processor to atomically test and modify.
    It is implemented based on CPU atomic instructions. The Swoole atomic variables have to 
    defined before swoole_server-&gt;start.
  </p>

  <p class="para">
    Compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. 
    It compares the content of a memory location with a given value and, only if they are the same, 
    modifies the content of that memory location to a new given value.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-swoole-atomic.construct-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">value</code></dt>
    <dd>
     <p class="para">
      The value of the atomic object.
     </p>
    </dd>
   
  </dl>
 </div>


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