Module: xenomai-jki Branch: for-forge Commit: f09ad577f233ea03558053643fd260ffcfc0aaee URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=f09ad577f233ea03558053643fd260ffcfc0aaee
Author: Jan Kiszka <jan.kis...@siemens.com> Date: Mon Nov 18 19:08:11 2013 +0100 switchtest: Bail out early from rtswitch_ktask on termination rtswitch_pend_rt may have been interrupted if the task is supposed to stop. Reorder the test for this in order to avoid starting to run on invalid data. Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- kernel/drivers/testing/switchtest.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/drivers/testing/switchtest.c b/kernel/drivers/testing/switchtest.c index 6f77ee9..8850962 100644 --- a/kernel/drivers/testing/switchtest.c +++ b/kernel/drivers/testing/switchtest.c @@ -400,7 +400,7 @@ static void rtswitch_ktask(void *cookie) rtswitch_pend_rt(ctx, task->base.index); - for(;;) { + while (!rtdm_task_should_stop()) { if (task->base.flags & RTTST_SWTEST_USE_FPU) fp_regs_set(fp_features, task->base.index + i * 1000); @@ -433,9 +433,6 @@ static void rtswitch_ktask(void *cookie) } } - if (rtdm_task_should_stop()) - break; - if (++i == 4000000) i = 0; } _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git