PHP 8.5.0 Alpha 2 available for testing

Thread::isStarted

(PECL pthreads >= 2.0.0)

Thread::isStartedDetección de estado

Descripción

public Thread::isStarted(): bool

Indica si el Thread referenciado ha sido iniciado.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

Esta función retorna true en caso de éxito o false si ocurre un error.

Ejemplos

Ejemplo #1 Indica si el Thread referenciado ha sido iniciado

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

El ejemplo anterior mostrará :

bool(true)

add a note

User Contributed Notes 1 note

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