(PECL pthreads >= 2.0.0)
Thread::getThreadId — 識(shí)別
返回引用線程的ID
此函數(shù)沒(méi)有參數(shù)。
線程ID,數(shù)字格式
示例 #1 返回引用線程的ID
<?php
class My extends Thread {
public function run() {
printf("%s is Thread #%lu\n", __CLASS__, $this->getThreadId());
}
}
$my = new My();
$my->start();
?>
以上例程會(huì)輸出:
My is Thread #123456778899