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); ?>

Swoole\Atomic::cmpset

(PECL swoole >= 1.9.0)

Swoole\Atomic::cmpsetCompare and set the value of the atomic object.

Açıklama

public Swoole\Atomic::cmpset(int $cmp_value, int $new_value): int

Bağımsız Değişkenler

cmp_value

The value to compare with the current value of the atomic object.

new_value

The value to set to the atomic object if the cmp_value is the same as the current value of the atomic object.

Dönen Değerler

The new value of the atomic object.