Home
My Account
About us
Products
Support Services
Buy online
Downloads
Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
PHP Manual
Swoole
Installing/Configuring
Predefined Constants
Swoole Functions
Swoole\Async
Swoole\Atomic
Swoole\Buffer
Swoole\Channel
Swoole\Client
Swoole\Connection\Iterator
Swoole\Coroutine
Swoole\Coroutine\Lock
Swoole\Event
Swoole\Exception
Swoole\Http\Client
Swoole\Http\Request
Swoole\Http\Response
Swoole\Http\Server
Swoole\Lock
Swoole\Mmap
Swoole\Module
Swoole\MySQL
Swoole\MySQL\Exception
Swoole\Process
Swoole\Redis\Server
Swoole\Runtime
Swoole\Serialize
Swoole\Server
Swoole\Table
Swoole\Timer
Swoole\WebSocket\Frame
Swoole\WebSocket\Server
Swoole\Async::writeFile
Swoole\Atomic::add
Swoole
Last updated: Mon, 26 Oct 2026
The Swoole\Atomic class
(PECL swoole >= 1.9.0)
Introduction
Class synopsis
class
Swoole\Atomic
{
/* Methods */
public
function
add
(
int
$add_value
= ?
):
int
public
function
cmpset
(
int
$cmp_value
,
int
$new_value
):
int
public
function
get
():
int
public
function
set
(
int
$value
):
int
public
function
sub
(
int
$sub_value
= ?
):
int
}
Table of Contents
Swoole\Atomic::add
— Add a number to the value to the atomic object.
Swoole\Atomic::cmpset
— Compare and set the value of the atomic object.
Swoole\Atomic::__construct
— Construct a swoole atomic object.
Swoole\Atomic::get
— Get the current value of the atomic object.
Swoole\Atomic::set
— Set a new value to the atomic object.
Swoole\Atomic::sub
— Subtract a number to the value of the atomic object.
Swoole\Async::writeFile
Swoole\Atomic::add
Swoole
Last updated: Mon, 26 Oct 2026