Threaded::isRunning

(PECL pthreads >= 2.0.0)

Threaded::isRunning状态锟斤拷锟�

说锟斤拷

public Threaded::isRunning ( void ) : bool

锟斤拷锟斤拷锟角凤拷锟斤拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷

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

锟斤拷锟斤拷值

锟斤拷示锟斤拷锟斤拷状态锟侥诧拷锟斤拷值

Note:

锟斤拷锟斤拷锟斤拷锟斤拷 run 锟斤拷锟斤拷锟斤拷锟斤拷执锟叫o拷锟斤拷锟接该讹拷锟斤拷为锟斤拷锟斤拷锟斤拷锟斤拷状态

锟斤拷锟斤拷

Example #1 锟斤拷锟斤拷锟斤拷状态

<?php
class My extends Thread {
    public function 
run() {
        
$this->synchronized(function($thread){
            if (!
$thread->done)
                
$thread->wait();
        }, 
$this);
    }
}
$my = new My();
$my->start();
var_dump($my->isRunning());
$my->synchronized(function($thread){
    
$thread->done true;
    
$thread->notify();
}, 
$my);
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

bool(true)