Skip to content

Commit 0acaa97

Browse files
mhagstrandkrakjoe
authored andcommitted
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.
1 parent abba56f commit 0acaa97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/sysvsem/tests/nowait.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ if ($pid) {
6767
exit;
6868
}
6969

70+
/* Release the child semahpore before releasing
71+
the releasing the parent semaphore and letting
72+
the child continue execution */
73+
sem_release($c_sem_id);
74+
7075
echo "P: releasing semaphore $p_sem_id.\n";
7176
if (!sem_release($p_sem_id)) {
7277
echo "P: failed to release semaphore\n";
7378
}
7479

75-
sem_release($c_sem_id);
7680
$status = null;
7781
pcntl_waitpid($pid, $status);
7882

0 commit comments

Comments
 (0)