[LTP] [PATCH 03/18] hugeshmctl01: Fix synchronisation with child processes

Cyril Hrubis chrubis@suse.cz
Tue Oct 31 12:04:08 CET 2017


Hi!
> hugeshmctl01 spawns child processes to perform shm operations and uses
> signal (SIGUSR1) to communicate the completion of test 1, to the
> children waiting at sigprocmask(). However, there is no guarantee that a
> child has reached sigprocmask() before the parent issues a SIGUSR1 and
> things go wrong.
> 
> This patch fixes this issue by 'stopping' the children, waiting for all
> of them and then issuing SIGCONT to communicate the completion.
> 
> While we are at it, also handle unknown signals as a hint to exit the
> test with TBROK.

We do have a checkpoint synchronization primitives in the test library
exactly for this kind of synchronization. Can you, pretty please, use
them instead?

https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#229-fork-and-parent-child-synchronization

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list