pthreads Thread::getCreatorId
(PECL pthreads >= 2.0.0)
Thread::getCreatorId — Identification
설명
public Thread::getCreatorId(): int
참조된 스레드를 생성한 스레드의 ID를 반환합니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
A numeric identity
Examples
예제 #1 참조된 스레드를 생성한 스레드 또는 프로세스의 ID를 반환합니다.
<?php
class My extends Thread {
public function run() {
printf("%s created by Thread #%lu\n", __CLASS__, $this->getCreatorId());
}
}
$my = new My();
$my->start();
?>
위의 예는 다음을 출력합니다.
My created by Thread #123456778899