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

classThreadextendsThreadedimplementsCountable, Traversable, ArrayAccess {
publicgetCreatorId(): int
publicstaticgetCurrentThread(): Thread
publicstaticgetCurrentThreadId(): int
publicgetThreadId(): int
publicisJoined(): bool
publicisStarted(): bool
publicjoin(): bool
publicstart(int$options = ?): bool
publicThreaded::chunk(int$size, bool$preserve): array
publicThreaded::merge(mixed$from, bool$overwrite = ?): bool
publicThreaded::synchronized(Closure$block, mixed...$args): mixed
publicThreaded::wait(int$timeout = ?): bool
}

Sommaire

To Top