The Thread class

(PECL pthreads >= 2.0.0)

Introduzione

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.

Avviso

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

Sommario della classe

class Thread extends Threaded implements Countable, Traversable, ArrayAccess {
/* Metodi */
public getCreatorId(): int
public static getCurrentThread(): Thread
public static getCurrentThreadId(): int
public getThreadId(): int
public isJoined(): bool
public isStarted(): bool
public join(): bool
public start(int $options = ?): bool
/* Metodi ereditati */
public Threaded::chunk(int $size, bool $preserve): array
public Threaded::extend(string $class): bool
public Threaded::merge(mixed $from, bool $overwrite = ?): bool
public Threaded::synchronized(Closure $block, mixed ...$args): mixed
public Threaded::wait(int $timeout = ?): bool
}

Indice dei contenuti