(PECL pthreads >= 2.0.0)
Threaded::isRunning — Détection de statut
Demande si l'objet référencé est en cours d'exécution.
Cette fonction ne contient aucun paramètre.
Un booléen indiquant le statut.
Note:
Un objet est considéré comme étant en cours d'exécution lorsqu'il exécute la méthode run.
Exemple #1 Détecte le statut de l'objet référencé
<?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);
?>
L'exemple ci-dessus va afficher :
bool(true)