note 92483 modified in function.pcntl-sigtimedwait by danbrown
| From: | danbrown@php.net | Date: | Mon, 27 Jul 2009 03:28:35 +0000 |
| Subject: | note 92483 modified in function.pcntl-sigtimedwait by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158759@lists.php.net to get a copy of this message | ||
In the case if pcntl_sigtimedwait() is unavailable (under Mac OS, under PHP < 5.3), you can pick
up the workaround:
<?php
if (!function_exists('pcntl_sigtimedwait'))
{
function pcntl_sigtimedwait($signals,$siginfo,$sec,$nano)
{
pcntl_signal_dispatch();
if (time_nanosleep($sec,$nano) === TRUE) {return FALSE;}
pcntl_signal_dispatch();
return TRUE;
}
}
?>
Behaviour of this function differs from original one. This function returns true if a signal was
retrieved and false if it was not retrieved. However, the timeout will be interrupted immediately
when signal sent.
--was--
In the case if pcntl_sigtimedwait() is unavailable (under Mac OS, under PHP < 5.3), you can pick
up the workaround:
if (!function_exists('pcntl_sigtimedwait'))
{
function pcntl_sigtimedwait($signals,$siginfo,$sec,$nano)
{
pcntl_signal_dispatch();
if (time_nanosleep($sec,$nano) === TRUE) {return FALSE;}
pcntl_signal_dispatch();
return TRUE;
}
}
Behaviour of this function differs from original one. This function returns true if a signal was
retrieved and false if it was not retrieved. However, the timeout will be interrupted immediately
when signal sent.
http://php.net/manual/en/function.pcntl-sigtimedwait.php