(PECL pthreads >= 2.0.0)
はじめに
このオブジェクトの start メソッドが呼ばれると、run メソッドのコードが個別のスレッドで並列処理されます。
run メソッドの実行後は Thread はすぐに終了し、作成元のスレッドに適切な時期に join します。
警告 Thread をいつ join させるのかをエンジンに決めさせていると、予期せぬ振る舞いを引き起こすことがあります。 可能な限り、プログラマーが明示的に指定するようにしましょう。
クラス概要
Thread extends Threaded implements Countable , Traversable , ArrayAccess {
public detach ( ) : void
public getCreatorId ( ) : int
public static getCurrentThread ( ) : Thread
public static getCurrentThreadId ( ) : int
public getThreadId ( ) : int
public isJoined ( ) : bool
public isStarted ( ) : bool
public join ( ) : bool
public kill ( ) : void
public start
([ int $options
] ) : bool
/* 継承したメソッド */
public Threaded::chunk
( int $size
, bool $preserve
) : array
public Threaded::count ( ) : int
public Threaded::extend
( string $class
) : bool
public Threaded::from
( Closure $run
[, Closure $construct
[, array $args
]] ) : Threaded
public Threaded::getTerminationInfo ( ) : array
public Threaded::isRunning ( ) : bool
public Threaded::isTerminated ( ) : bool
public Threaded::isWaiting ( ) : bool
public Threaded::lock ( ) : bool
public Threaded::merge
( mixed $from
[, bool $overwrite
] ) : bool
public Threaded::notify ( ) : bool
public Threaded::notifyOne ( ) : bool
public Threaded::pop ( ) : bool
public Threaded::run ( ) : void
public Threaded::shift ( ) : mixed
public Threaded::synchronized
( Closure $block
, mixed ...$args
) : mixed
public Threaded::unlock ( ) : bool
public Threaded::wait
([ int $timeout
] ) : bool
}
目次
- Thread::detach — Execution
- Thread::getCreatorId — 識別
- Thread::getCurrentThread — Identification
- Thread::getCurrentThreadId — Identification
- Thread::getThreadId — 識別
- Thread::globally — Execution
- Thread::isJoined — 状態を検出する
- Thread::isStarted — 状態を検出する
- Thread::join — 同期処理
- Thread::kill — Execution
- Thread::start — 実行する
/* メソッド */