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 ) : void
public get ( void ) : int
public inc ( void ) : void
public lock ( void ) : void
public set ( int $value ) : void
public unlock ( void ) : void
}

Table of Contents