Thread
PHP Manual

Thread::stack

(PECL pthreads >= 0.0.33)

Thread::stackPush work onto the stack for execution by the referenced Thread

说明

final public int Thread::stack ( Object $work )

Pushing work onto the stack of an executing Thread automatically turns that Thread into a Worker. A Worker Thread will automatically pop work off the stack and execute the items run method. A Worker Thread is available until a call to Thread::join() is recieved. The return value of the run method of an executed item is ignored, until the last execution on the stack. The last item on the stack has the return value of run available to the caller of Thread::join() on the Worker Thread.

参数

work

An item of the same type as the referenced Thread

返回值

The size of stack after work was added.


Thread
PHP Manual