From 0acaa97a164e50916575ee510bc69689f59e2201 Mon Sep 17 00:00:00 2001 From: Mitch Hagstrand Date: Mon, 2 Jan 2017 07:49:32 -0800 Subject: [PATCH] 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. --- ext/sysvsem/tests/nowait.phpt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.40.0