downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Thread::isStarted> <Thread::isJoined
[edit] Last updated: Fri, 17 May 2013

view this page in

Thread::isRunning

(PECL pthreads >= 0.34)

Thread::isRunningState Detection

Descripción

final public boolean Thread::isRunning ( void )

Tell if the referenced Thread is executing

Parámetros

Esta función no tiene parámetros.

Valores devueltos

A boolean indication of state

Nota:

A Thread is considered running while executing the run method

Ejemplos

Ejemplo #1 Detect the state of the referenced Thread

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

El resultado del ejemplo sería:

bool(true)



add a note add a note User Contributed Notes Thread::isRunning - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites