PHP - Fonction Threaded :: isWaiting ()

Threaded :: isWaiting - Détection d'état.

Syntaxe

public boolean Threaded::isWaiting( void )

La fonction Threaded :: isWaiting peut dire si un objet référencé attend la notification.

La fonction Threaded :: isWaiting n'a aucun paramètre et peut renvoyer une indication booléenne d'état.

Exemple

<?php
   class My extends Thread {
      public function run() {
         $this->synchronized(function($thread) {
            if(!$this->done)
               $thread->wait();
         }, $this);
      }
      protected $done;
   }
   $my = new My();
   $my->start();
   $my->synchronized(function($thread) {
      var_dump($thread->isWaiting());
      $thread->done = true;
      $thread->notify();
   }, $my);
?>