PHP - Thread::getCreatorId() 函式



Thread::getCreatorId - 標識

語法

public integer Thread::getCreatorId( void )

Thread::getCreatorId() 函式可以返回建立引用執行緒的執行緒的標識。

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

示例

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