(PECL pthreads >= 2.0.0)
Threaded::notify — 同锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷锟斤拷突锟斤拷锟酵ㄖ�
锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷
锟斤拷锟斤拷值锟斤拷锟斤拷示锟斤拷锟斤拷锟角凤拷晒锟�
Example #1 锟饺达拷锟酵伙拷锟斤拷
<?php
class My extends Thread {
public function run() {
/** 锟斤拷锟竭程等达拷 **/
$this->synchronized(function($thread){
if (!$thread->done)
$thread->wait();
}, $this);
}
}
$my = new My();
$my->start();
/** 锟斤拷锟节等达拷状态锟斤拷锟竭程凤拷锟酵伙拷锟斤拷通知 **/
$my->synchronized(function($thread){
$thread->done = true;
$thread->notify();
}, $my);
var_dump($my->join());
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
bool(true)