# HG changeset patch # User Dan # Date 1222278443 14400 # Node ID a6b339665650a41cdc4c54cc885b2f5fa0aec886 # Parent ab35414653823b9198630a2bd20225c7970786b9 Fixed broken FORK_CHILD usage. diff -r ab3541465382 -r a6b339665650 multithreading.php --- a/multithreading.php Wed Sep 24 00:18:21 2008 -0400 +++ b/multithreading.php Wed Sep 24 13:47:23 2008 -0400 @@ -130,12 +130,15 @@ { global $threader_instances; - declare(ticks=1); - - $threader_instances[] =& $this; - - pcntl_signal(SIGUSR2, 'Threader_SigUsr2'); - pcntl_signal(SIGCHLD, 'Threader_SigChld'); + if ( function_exists('pcntl_signal') ) + { + declare(ticks=1); + + $threader_instances[] =& $this; + + pcntl_signal(SIGUSR2, 'Threader_SigUsr2'); + pcntl_signal(SIGCHLD, 'Threader_SigChld'); + } $this->json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $this->parent_pid = getmypid(); @@ -170,7 +173,7 @@ fclose($socket_pair[1]); $this->parent_sock = $socket_pair[0]; $this->is_child = true; - return FORK_CHILD; + return self::FORK_CHILD; } } diff -r ab3541465382 -r a6b339665650 webserver.php --- a/webserver.php Wed Sep 24 00:18:21 2008 -0400 +++ b/webserver.php Wed Sep 24 13:47:23 2008 -0400 @@ -508,7 +508,7 @@ // fork off if possible if ( function_exists('pcntl_fork') && $this->allow_fork && !$this->in_keepalive ) { - if ( $this->threader->fork() == FORK_CHILD ) + if ( $this->threader->fork() == Threader::FORK_CHILD ) { // this is the child define('HTTPD_WS_CHILD', 1);