Threaded::wait
Synchronisation
&reftitle.description;
public boolThreaded::wait
inttimeout
Fera attendre le contexte appelant une notification depuis l'objet référencé.
&reftitle.parameters;
timeout
Un délai d'attente maximal optionnel, en microsecondes.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
Notifications et attente
synchronized(function($thread){
if (!$thread->done)
$thread->wait();
}, $this);
}
}
$my = new My();
$my->start();
/** Envoi la notification au threadé qui attend **/
$my->synchronized(function($thread){
$thread->done = true;
$thread->notify();
}, $my);
var_dump($my->join());
?>
]]>
&example.outputs;