Module: xenomai-forge Branch: next Commit: 76938af20b38e33954b9b7133f0055187f26f24f URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=76938af20b38e33954b9b7133f0055187f26f24f
Author: Jan Kiszka <jan.kis...@siemens.com> Date: Mon Nov 18 19:08:11 2013 +0100 testsuite/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 b7b6a21..354dece 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