summaryrefslogtreecommitdiff
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:44:43 +0000
commitc019d33267ef04959250e89856f1f0f57e9dcb3d (patch)
tree8781a5a863a5619e30555d348f1e975d34d02002
parent732f67ee6ff608853a4c1a757e6746b44bb3b125 (diff)
downloadphp-git-c019d33267ef04959250e89856f1f0f57e9dcb3d.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.
-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);