%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/public_html/admin1/vendor/amphp/process/lib/Internal/Posix/ |
Upload File : |
<?php
namespace Amp\Process\Internal\Posix;
use Amp\Deferred;
use Amp\Loop;
use Amp\Process\Internal\ProcessHandle;
/** @internal */
final class Handle extends ProcessHandle
{
public function __construct()
{
$this->pidDeferred = new Deferred;
$this->joinDeferred = new Deferred;
$this->originalParentPid = \getmypid();
}
/** @var Deferred */
public $joinDeferred;
/** @var resource */
public $proc;
/** @var resource */
public $extraDataPipe;
/** @var string */
public $extraDataPipeWatcher;
/** @var string */
public $extraDataPipeStartWatcher;
/** @var int */
public $originalParentPid;
/** @var int */
public $shellPid;
public function wait()
{
if ($this->shellPid === 0) {
return;
}
$pid = $this->shellPid;
$this->shellPid = 0;
Loop::unreference(Loop::repeat(100, static function (string $watcherId) use ($pid) {
if (!\extension_loaded('pcntl') || \pcntl_waitpid($pid, $status, \WNOHANG) !== 0) {
Loop::cancel($watcherId);
}
}));
}
public function __destruct()
{
$this->wait();
}
}