On 09/11/2015 01:54 PM, Vincent Guittot wrote:
Hi Vincent,
If a sigterm is raised once we have installed our own handler but threads are not already created, we deadlock in the shutdown function.
So, we don't wait anymore for thread until all threads has been created which is not a big issue because we don't really care of gathering all logs and traces before exiting rt-app in this case as the use case has not started yet.
Reported-by: Daniel Lezcano daniel.lezcano@linaro.org Signed-off-by: Vincent Guittot vincent.guittot@linaro.org
src/rt-app.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/rt-app.c b/src/rt-app.c index f14f228..bbc8594 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -32,6 +32,7 @@ static int errno; static volatile int continue_running; static pthread_t *threads; static int nthreads; +static int running_threads; static int p_load; rtapp_options_t opts;
@@ -353,6 +354,10 @@ static void shutdown(int sig) { int i;
- if(!continue_running)
return;
if you use a global variable in a signal handler you should use the type:
static volatile sig_atomic_t