pthreads
PHP Manual

The Thread class

(PECL pthreads >= 2.0.0)

Introduction

When the start method of a Thread is invoked, the run method code will be executed in separate Thread, in parallel.

After the run method is executed the Thread will exit immediately, it will be joined with the creating Thread at the appropriate time.

Warning

Relying on the engine to determine when a Thread should join may cause undesirable behaviour; the programmer should be explicit, where possible.

Class synopsis

Thread extends Threaded implements Countable , Traversable , ArrayAccess {
/* Methods */
public void detach ( void )
public int getCreatorId ( void )
public static Thread getCurrentThread ( void )
public static int getCurrentThreadId ( void )
public int getThreadId ( void )
public static mixed globally ( void )
public bool isJoined ( void )
public bool isStarted ( void )
public bool join ( void )
public void kill ( void )
public bool start ([ int $options ] )
/* Inherited methods */
public array Threaded::chunk ( int $size , bool $preserve )
public int Threaded::count ( void )
public bool Threaded::extend ( string $class )
public Threaded Threaded::from ( Closure $run [, Closure $construct [, array $args ]] )
public array Threaded::getTerminationInfo ( void )
public bool Threaded::isRunning ( void )
public bool Threaded::isTerminated ( void )
public bool Threaded::isWaiting ( void )
public bool Threaded::lock ( void )
public bool Threaded::merge ( mixed $from [, bool $overwrite ] )
public bool Threaded::notify ( void )
public bool Threaded::notifyOne ( void )
public bool Threaded::pop ( void )
public void Threaded::run ( void )
public mixed Threaded::shift ( void )
public mixed Threaded::synchronized ( Closure $block [, mixed $... ] )
public bool Threaded::unlock ( void )
public bool Threaded::wait ([ int $timeout ] )
}

Table of Contents


pthreads
PHP Manual