pthreads
PHP Manual

La classe Thread

(PECL pthreads >= 2.0.0)

Introduction

Quand la méthode start d'un Thread est appelée, le code de la méthode run sera exécuté de façon parallèle dans un Thread séparé.

Après l'exécution de la méthode run, le Thread se terminera immédiatement, il sera rattaché au Thread d'origine par la suite.

Avertissement

S'appuyer sur le moteur pour déterminer quand un Thread sera rattaché peut provoquer un comportement non désiré. Le développeur doit être explicite tant que possible.

Synopsis de la classe

Thread extends Threaded implements Countable , Traversable , ArrayAccess {
/* Méthodes */
public void detach ( void )
public integer getCreatorId ( void )
public static Thread getCurrentThread ( void )
public static integer getCurrentThreadId ( void )
public integer getThreadId ( void )
public static mixed globally ( void )
public boolean isJoined ( void )
public boolean isStarted ( void )
public boolean join ( void )
public void kill ( void )
public boolean start ([ integer $options ] )
/* Méthodes héritées */
public array Threaded::chunk ( integer $size , boolean $preserve )
public integer 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 boolean Threaded::isRunning ( void )
public boolean Threaded::isTerminated ( void )
public boolean Threaded::isWaiting ( void )
public boolean Threaded::lock ( void )
public boolean Threaded::merge ( mixed $from [, bool $overwrite ] )
public boolean Threaded::notify ( void )
public boolean Threaded::notifyOne ( void )
public boolean Threaded::pop ( void )
public void Threaded::run ( void )
public boolean Threaded::shift ( void )
public mixed Threaded::synchronized ( Closure $block [, mixed $... ] )
public boolean Threaded::unlock ( void )
public boolean Threaded::wait ([ integer $timeout ] )
}

Sommaire


pthreads
PHP Manual