/** * \file * * * * \brief Test kernel preemption. * * This testcase spawns TASKS parallel threads that runs for TIME seconds. They * continuously spin updating a global counter (one counter for each thread). * * At exit each thread checks if the others have been che chance to update * their own counter. If not, it means the preemption didn't occur and the * testcase returns an error message. * * Otherwise, if all the threads have been able to update their own counter it * means preemption successfully occurs, since there is no active sleep inside * each thread's implementation. * * \author Andrea Righi * * $test$: cp bertos/cfg/cfg_proc.h $cfgdir/ * $test$: echo "#undef CONFIG_KERN" >> $cfgdir/cfg_proc.h * $test$: echo "#define CONFIG_KERN 1" >> $cfgdir/cfg_proc.h * $test$: cp bertos/cfg/cfg_monitor.h $cfgdir/ * $test$: sed -i "s/CONFIG_KERN_MONITOR 0/CONFIG_KERN_MONITOR 1/" $cfgdir/cfg_monitor.h * $test$: cp bertos/cfg/cfg_signal.h $cfgdir/ * $test$: echo "#undef CONFIG_KERN_SIGNALS" >> $cfgdir/cfg_signal.h * $test$: echo "#define CONFIG_KERN_SIGNALS 1" >> $cfgdir/cfg_signal.h * * notest: all */ #include "../proc_test.c"