Module: xenomai-rpm Branch: for-upstream Commit: 466d810ac9b61b06eaa9cb28815d95f063084fb8 URL: http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=466d810ac9b61b06eaa9cb28815d95f063084fb8
Author: Philippe Gerum <r...@xenomai.org> Date: Wed Mar 10 11:44:34 2010 +0100 testsuite/latency: fix false positive in mode switch detection When ^C is depressed to stop the test, receiving SIGINT on the sampling task must have caused a mode switch notification earlier. This is a false positive wrt involuntary mode switch reporting, ignore it. Masking SIGINT for the sampling task would require an initial mode switch we might not want to perform either. --- src/testsuite/latency/latency.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c index 4df8e7f..08f9c19 100644 --- a/src/testsuite/latency/latency.c +++ b/src/testsuite/latency/latency.c @@ -437,6 +437,21 @@ void cleanup(void) void sighand(int sig __attribute__ ((unused))) { + RT_TASK *me; + + if (sig == SIGINT) { + /* + * Receiving SIGINT on the sampling task must have + * caused a mode switch notification earlier. This is + * a false positive wrt involuntary mode switch + * reporting, ignore it. + */ + me = rt_task_self(); + if (me && rt_task_same(me, &latency_task) && + sampling_relaxed > 0) + sampling_relaxed--; + } + finished = 1; } _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git