Swoole\Atomic::cmpset
PHP Manual
PHP Manual»Swoole\Atomic»Swoole\Atomic::cmpset

Swoole\Atomic::cmpset

(PECL swoole >= 1.9.0)

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

Descrizione

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

Elenco dei parametri

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.

Valori restituiti

The new value of the atomic object.

To Top