Php/docs/pht-thread.join

来自菜鸟教程
跳转至:导航、​搜索

pht\Thread::join

(PECL pht >= 0.0.1)

pht\Thread::joinJoins a thread


说明

public pht\Thread::join ( ) : void

This method will join the spawned thread (though it will first wait for that thread's internal task queue to finish). As a matter of good practice, threads should always be joined. Not joining a thread may lead to undefined behaviour.


参数

此函数没有参数。


返回值

No return value.


范例

Example #1 Joining a thread

<?phpuse pht\Thread;$thread = new Thread();$thread->start();$thread->join();