Thread::isJoined

(PECL pthreads >= 2.0.0)

Thread::isJoinedDétection de statut

Description

public Thread::isJoined(): 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

Cette fonction retourne true en cas de succès ou false si une erreur survient.

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)

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top