(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)