(PECL pthreads >= 2.0.0)
Pool::shutdown — 关闭所有工作进程
此函数没有参数。
不返回值。
示例 #1 关闭池
<?php
class Task extends Threaded
{
public function run()
{
usleep(500000);
}
}
$pool = new Pool(4);
for ($i = 0; $i < 10; ++$i) {
$pool->submit(new Task());
}
$pool->shutdown(); // blocks until all submitted tasks have finished executing