PHP - Thread::getThreadId() 函式



Thread::getThreadId - 標識

語法

public integer Thread::getThreadId( void )

Thread::getThreadId() 函式可以返回所引用執行緒的標識。

Thread::getThreadId() 函式沒有任何引數,並返回一個數字標識。

示例

<?php
   class My extends Thread {
      public function run() {
         printf("%s is Thread #%lu\n", __CLASS__, $this->getThreadId());
      }
   }
   $my = new My();
   $my->start();
?>
php_function_reference.htm
廣告