W3cubDocs

/PHP

The Threaded class

Introduction

(PECL pthreads >= 2.0.0)

Threaded objects form the basis of pthreads ability to execute user code in parallel; they expose synchronization methods and various useful interfaces.

Threaded objects, most importantly, provide implicit safety for the programmer; all operations on the object scope are safe.

Class synopsis

Threaded implements Collectable , Traversable , Countable , ArrayAccess {
/* Methods */
public chunk ( int $size , bool $preserve ) : array
public count ( ) : int
public extend ( string $class ) : bool
public from ( Closure $run [, Closure $construct [, array $args ]] ) : Threaded
public getTerminationInfo ( ) : array
public isRunning ( ) : bool
public isTerminated ( ) : bool
public isWaiting ( ) : bool
public lock ( ) : bool
public merge ( mixed $from [, bool $overwrite ] ) : bool
public notify ( ) : bool
public notifyOne ( ) : bool
public pop ( ) : bool
public run ( ) : void
public shift ( ) : mixed
public synchronized ( Closure $block , mixed ...$args ) : mixed
public unlock ( ) : bool
public wait ([ int $timeout ] ) : bool
}

Table of Contents

© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.threaded.php