The AtomicInteger class

(PECL pht >= 0.0.1)

简介

The pht\AtomicInteger class is currently the only supported atomic value. It allows for an integer to be safely passed around between, and manipulated, by multiple threads. The methods exposed by this class do not need mutex locking, since they will acquire the internal mutex lock implicitly. pht\AtomicInteger::lock() and pht\AtomicInteger::unlock() are still exposed, however, for when multiple operations involving the same pht\AtomicInteger object need to be grouped together.

The mutex locks of the atomic values are reentrant safe.

类摘要

pht\AtomicInteger implements pht\Threaded {
/* 方法 */
public __construct ( int $value = 0 ) : AtomicInteger
public dec ( ) : void
public get ( ) : int
public inc ( ) : void
public lock ( ) : void
public set ( int $value ) : void
public unlock ( ) : void
}

Table of Contents

User Contributed Notes

There are no user contributed notes for this page.
PHP8中文手册 站长在线 整理 版权归PHP文档组所有