pcntl_signal_dispatch

(PHP 5 >= 5.3.0, PHP 7)

pcntl_signal_dispatch锟斤拷锟矫等达拷锟脚号的达拷锟斤拷锟斤拷

说锟斤拷

pcntl_signal_dispatch ( void ) : bool

锟斤拷锟斤拷pcntl_signal_dispatch()锟斤拷锟斤拷每锟斤拷锟饺达拷锟脚猴拷通锟斤拷pcntl_signal() 锟斤拷装锟侥达拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #1 pcntl_signal_dispatch() 示锟斤拷

<?php
echo "锟斤拷装锟脚号达拷锟斤拷锟斤拷...\n";
pcntl_signal(SIGHUP,  function($signo) {
     echo 
"锟脚号达拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷\n";
});

echo 
"为锟皆硷拷锟斤拷锟斤拷SIGHUP锟脚猴拷...\n";
posix_kill(posix_getpid(), SIGHUP);

echo 
"锟街凤拷...\n";
pcntl_signal_dispatch();

echo 
"锟斤拷锟絓n";

?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

锟斤拷装锟脚号达拷锟斤拷锟斤拷...
为锟皆硷拷锟斤拷锟斤拷SIGHUP锟脚猴拷...
锟街凤拷...
锟脚号达拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
锟斤拷锟�

锟轿硷拷