GoLang Swoole\Atomic::cmpset

request it (275)
GoLang replacement for PHP's Swoole\Atomic::cmpset [edit | history]



Do you know a GoLang replacement for PHP's Swoole\Atomic::cmpset? Write it!

PHP Swoole\Atomic::cmpset

PHP original manual for Swoole\Atomic::cmpset [ show | php.net ]

Swoole\Atomic::cmpset

(PHP 5 >= 5.2.0, PHP 7, PECL swoole >= 1.9.0)

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

Description

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

Parameters

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.

Return Values

The new value of the atomic object.