array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'swoole-atomic.cmpset.php', 1 => 'Swoole\\Atomic::cmpset', 2 => 'Compare and set the value of the atomic object.', ), 'up' => array ( 0 => 'class.swoole-atomic.php', 1 => 'Swoole\\Atomic', ), 'prev' => array ( 0 => 'swoole-atomic.add.php', 1 => 'Swoole\\Atomic::add', ), 'next' => array ( 0 => 'swoole-atomic.construct.php', 1 => 'Swoole\\Atomic::__construct', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/swoole/swoole/atomic/cmpset.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL swoole >= 1.9.0)
Swoole\Atomic::cmpset — Compare and set the value of the atomic object.
cmp_valueThe value to compare with the current value of the atomic object.
new_valueThe value to set to the atomic object if the cmp_value is the same as the current value of the atomic object.
The new value of the atomic object.