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

Sommaire