/** * Change child process priority according to EXTENDER_NICENESS * */ private static function adjustNiceness($pid, $logger) { if (Checks::multithread() and defined("EXTENDER_CHILD_NICENESS")) { $niceness = pcntl_setpriority($pid, EXTENDER_CHILD_NICENESS); if ($niceness == false) { $logger->warning("Unable to set child process " . $pid . " niceness to " . EXTENDER_CHILD_NICENESS); } } }
/** * Get multithread mode status * * @return bool True if enabled, false if disabled */ public final function getMultithreadMode() { return ($this->multithread_mode and Checks::multithread()) ? true : false; }
public static function doCheck() { return array("constants" => Checks::constants(), "multithread" => Checks::multithread(), "signals" => Checks::signals(), "database" => Checks::database(), "real_path" => EXTENDER_REAL_PATH, "multithread_enabled" => EXTENDER_MULTITHREAD_ENABLED, "idle_time" => EXTENDER_IDLE_TIME, "max_result_bytes" => EXTENDER_MAX_RESULT_BYTES, "max_childs" => EXTENDER_MAX_CHILDS, "max_childs_runtime" => EXTENDER_MAX_CHILDS_RUNTIME, "parent_niceness" => defined('EXTENDER_PARENT_NICENESS') ? EXTENDER_PARENT_NICENESS : null, "child_niceness" => defined('EXTENDER_CHILD_NICENESS') ? EXTENDER_CHILD_NICENESS : null); }