sem_post/8-1: improve "child blocked on semaphore" detection

With POSIX semaphore we can't tell how many processes are waiting
on semaphore. Each child process in this test uses 2 semaphores,
first can always be taken and is used only for its semval (as counter),
to tell if child started and presumably will soon block on the second
semaphore.

Test assumes that if child holds first semaphore, then it will
take second one within 100us.

This patch replaces that sleep with a wait until child process
state changes to 'S' (sleeping).

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
2 files changed