Swoole\Atomic::__construct
(PECL swoole >= 1.9.0)
Swoole\Atomic::__construct — Construct a swoole atomic object.
Description
public function Swoole\Atomic::__construct(
int $value = ?)
Compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization.
It compares the content of a memory location with a given value and, only if they are the same,
modifies the content of that memory location to a new given value.
Parameters
value
-
The value of the atomic object.