Thread::getCreatorId

(PECL pthreads >= 2.0.0)

Thread::getCreatorIdIdentificación

Descripción

public Thread::getCreatorId(): int

Devuelve la identidad del Thread que ha creado el Thread referenciado.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Una identidad numérica.

Ejemplos

Ejemplo #1 Devuelve la identidad del Thread o del proceso que ha creado el Thread referenciado

<?php
class My extends Thread {
public function
run() {
printf("%s ha sido creado por el Thread #%lu\n", __CLASS__, $this->getCreatorId());
}
}
$my = new My();
$my->start();
?>

El resultado del ejemplo sería:

My ha sido creado por el Thread #123456778899

add a note

User Contributed Notes

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