PHP 8.3.4 Released!

pcntl_sigtimedwait

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

pcntl_sigtimedwait带超时机制的信号等待

说明

pcntl_sigtimedwait(
    array $signals,
    array &$info = [],
    int $seconds = 0,
    int $nanoseconds = 0
): int|false

pcntl_sigtimedwait() 函数实际上与 pcntl_sigwaitinfo() 的行为一致,不同在于它多了两个增强参数 secondsnanoseconds,这使得脚本等待的事件有了一个时间的上限。

参数

signals

要等待的信号列表数组。

info

info 设置为数组,包含信号的信息。参见 pcntl_sigwaitinfo()

seconds

超时秒数。

nanoseconds

超时纳秒数。

返回值

成功时 pcntl_sigtimedwait() 返回信号编号, 或者在失败时返回 false

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top