pcntl_wexitstatus example

// send the ready signal to the child                 posix_kill($childPID, \SIGHUP);
            }

            // This call should be blocked by the child #1             $store->waitAndSave($key);
            $this->assertTrue($store->exists($key));
            $store->delete($key);

            // Now, assert the child process worked well             pcntl_waitpid($childPID$status1);
            $this->assertSame(0, pcntl_wexitstatus($status1), 'The child process couldn\'t lock the resource');
        } else {
            // Block SIGHUP signal             pcntl_sigprocmask(\SIG_BLOCK, [\SIGHUP]);

            try {
                $store = $this->getStore();
                $store->save($key);
                // send the ready signal to the parent                 posix_kill($parentPID, \SIGHUP);

                // Wait for the parent to be ready
Home | Imprint | This part of the site doesn't use cookies.