Thread::isStarted

(PECL pthreads >= 2.0.0)

Thread::isStartedDétection de statut

Description

public Thread::isStarted(): bool

Indique si le Thread référencé a été démarré.

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 Indique si le Thread référencé a été démarré

<?php
$worker 
= new Worker();
$worker->start();
var_dump($worker->isStarted());
?>

L'exemple ci-dessus va afficher :

bool(true)

add a note add a note

User Contributed Notes 1 note

up
6
ricardo dot boss at web dot de
7 years ago
Even if you kill() a thread, the isStarted() method will still return true.
To Top