php-doc-en/reference/pht/atomicinteger/set.xml
Thomas Punt 93d68fe8a9 Namespace the pht extension
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344250 c90b9560-bf6c-de11-be94-00142212c4b1
2018-02-13 12:12:25 +00:00

94 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="pht.atomicinteger.set" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>pht\AtomicInteger::set</refname>
<refpurpose>Sets the atomic integer's value</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>pht\AtomicInteger::set</methodname>
<methodparam><type>int</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
This method will set the value of the atomic integer. Internally, the mutex
lock of the atomic integer will be acquired, and so there is no need to
manually acquire it (unless this operation needs to be grouped with other
operations on the same atomic integer - see the example in
<methodname>pht\AtomicInteger::lock</methodname> for a demonstration of this).
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to set the atomic integer to.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
No return value.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Setting an atomic integer's value</title>
<programlisting role="php">
<![CDATA[
<?php
use pht\AtomicInteger;
$atomicInteger = new AtomicInteger();
$atomicInteger->set(20);
var_dump($atomicInteger->get());
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(20)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->