Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 1196

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Destroy a Condition</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cond.create.html">Cond::create</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cond.signal.html">Cond::signal</a></div>
 <div class="up"><a href="class.cond.html">Cond</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cond.destroy" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Cond::destroy</h1>
  <p class="verinfo">(PECL pthreads &gt;= 0.34)</p><p class="refpurpose"><span class="refname">Cond::destroy</span> &mdash; <span class="dc-title">Destroy a Condition</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cond.destroy-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> 
   <span class="modifier">public</span> 
   <span class="modifier">static</span> 
   <span class="type">boolean</span>
    <span class="methodname"><strong>Cond::destroy</strong></span>
    ( <span class="methodparam">
 <span class="type"><span class="type long">long</span></span>
  <code class="parameter">$condition</code>
  </span>
   )</div>

  <p class="para rdfs-comment">
 Destroying Condition Variable handles must be carried out explicitly by the programmer when they are finished with the Condition Variable.
 No Threads should be blocking on a call to  <span class="function"><a href="cond.wait.html" class="function">Cond::wait()</a></span> when the call to  <span class="function"><strong>Cond::destroy()</strong></span> takes place.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-cond.destroy-parameters">
  <h3 class="title">Parameters</h3>
  <dl>

   <dt>

    <span class="term"><em><code class="parameter">condition</code></em></span>
    <dd>

     <p class="para">
 A handle to a Condition Variable returned by a previous call to  <span class="function"><a href="cond.create.html" class="function">Cond::create()</a></span>
     </p>
    </dd>

   </dt>

  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-cond.destroy-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
 A boolean indication of success.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cond.destroy-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3718">
    <p><strong>Example #1 Condition Creation and Destruction</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**&nbsp;You&nbsp;cannot&nbsp;use&nbsp;the&nbsp;"new"&nbsp;keyword,&nbsp;a&nbsp;Cond&nbsp;is&nbsp;not&nbsp;a&nbsp;PHP&nbsp;object&nbsp;**/<br /></span><span style="color: #0000BB">$cond&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Cond</span><span style="color: #007700">::</span><span style="color: #0000BB">create</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">/**&nbsp;You&nbsp;can&nbsp;now&nbsp;use&nbsp;the&nbsp;Cond&nbsp;in&nbsp;any&nbsp;context&nbsp;**/<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cond</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/**&nbsp;Always&nbsp;destroy&nbsp;Cond&nbsp;you&nbsp;have&nbsp;created&nbsp;**/<br /></span><span style="color: #0000BB">Cond</span><span style="color: #007700">::</span><span style="color: #0000BB">destroy</span><span style="color: #007700">(</span><span style="color: #0000BB">$cond</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
int(4540682)
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cond.create.html">Cond::create</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cond.signal.html">Cond::signal</a></div>
 <div class="up"><a href="class.cond.html">Cond</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>