summaryrefslogtreecommitdiff
path: root/ext/sysvsem
diff options
context:
space:
mode:
authorMitch Hagstrand <mhagstrand@gmail.com>2017-01-02 07:49:32 -0800
committerJoe Watkins <krakjoe@php.net>2017-01-02 16:46:19 +0000
commitfa1f98f2a36b3775062936d6383b1cd639b6ac32 (patch)
tree5f0060136720a8b80f1602101aeff803e2dfeb1c /ext/sysvsem
parentdfb6cdb61792f1525e7014305e5f31dd313da264 (diff)
downloadphp-git-fa1f98f2a36b3775062936d6383b1cd639b6ac32.tar.gz
Fix for nowait.phpt failing intermittently
The parent process was releasing the child semaphore after the child process continued execution. Now the child semaphore is released before the child process continues execution.
Diffstat (limited to 'ext/sysvsem')
-rw-r--r--ext/sysvsem/tests/nowait.phpt6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt
index 8557ce33ee..23f0dfc165 100644
--- a/ext/sysvsem/tests/nowait.phpt
+++ b/ext/sysvsem/tests/nowait.phpt
@@ -67,12 +67,16 @@ if ($pid) {
exit;
}
+ /* Release the child semahpore before releasing
+ the releasing the parent semaphore and letting
+ the child continue execution */
+ sem_release($c_sem_id);
+
echo "P: releasing semaphore $p_sem_id.\n";
if (!sem_release($p_sem_id)) {
echo "P: failed to release semaphore\n";
}
- sem_release($c_sem_id);
$status = null;
pcntl_waitpid($pid, $status);