(PECL pthreads < 3.0.0)
Threaded::isWaiting — 状态检测
pthreads v3 中已移除此方法。
检测对象是否在等待其他线程唤醒
此函数没有参数。
布尔值,表示是否处于等待唤醒状态
示例 #1 检测对象状态
<?php
class My extends Thread {
    public function run() {
        $this->synchronized(function($thread){
            if (!$this->done)
                $thread->wait();
        }, $this);
    }
    
    protected $done;
}
$my = new My();
$my->start();
$my->synchronized(function($thread){
    var_dump(
        $thread->isWaiting());
    $thread->done = true;
    $thread->notify();
}, $my);
?>
以上例程会输出:
bool(true)