Threaded::isWaiting

(PECL pthreads < 3.0.0)

Threaded::isWaiting状态锟斤拷锟�

Warning

pthreads v3 锟斤拷锟斤拷锟狡筹拷锟剿凤拷锟斤拷锟斤拷

说锟斤拷

public Threaded::isWaiting ( void ) : bool

锟斤拷锟斤拷锟斤拷锟角凤拷锟节等达拷锟斤拷锟斤拷锟竭程伙拷锟斤拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷值锟斤拷锟斤拷示锟角凤拷锟节等达拷锟斤拷锟斤拷状态

锟斤拷锟斤拷

Example #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)