• PHP Video Tutorials

PHP - Thread::isJoined() Function



Thread::isJoined - State Detection

Syntax

public boolean Thread::isJoined( void )

Thread::isJoined() function can tell if the referenced Thread has been joined.

Thread::isJoined() function doesn't have any parameters and can return a boolean indication of the state.

Example

<?php
   class My extends Thread {
      public function run() {
         $this->synchronized(function($thread) {
            $thread->wait();
         }, $this);
      }
   }
   $my = new My();
   $my->start();
   var_dump($my->isJoined());
   $my->synchronized(function($thread){
      $thread->notify();
   }, $my);
?>
php_function_reference.htm
Advertisements