PHP 8.1.0 RC 4 available for testing

The Thread class

(PECL pht >= 0.0.1)

はじめに

The pht\Thread class abstracts away a native thread. It has an internal task queue, where the methods pht\Thread::addClassTask(), pht\Thread::addFunctionTask(), and pht\Thread::addFileTask() push new tasks onto this queue. Invoking the pht\Thread::start() method will cause the new thread to be spawned, where it will then begin working through the task queue. A thread may be reused for any number of tasks.

クラス概要

class pht\Thread {
/* メソッド */
public addClassTask(string $className, mixed ...$ctorArgs): void
public addFileTask(string $fileName, mixed ...$globals): void
public addFunctionTask(callable $func, mixed ...$funcArgs): void
public join(): void
public start(): void
public taskCount(): int
}

目次

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top