Thread::isJoined

(PECL pthreads >= 2.0.0)

Thread::isJoinedDétection de statut

Description

public Thread::isJoined ( void ) : bool

Indique si le Thread référencé a été joint.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Un booléen indiquant le statut de l'opération.

Exemples

Exemple #1 Détecte le statut du Thread 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->isJoined());
$my->synchronized(function($thread){
    
$thread->done true;
    
$thread->notify();
}, 
$my);
?>

L'exemple ci-dessus va afficher :

bool(false)