Blame |
Last modification |
View Log
| RSS feed
#include <kernel/kern.h>
#include <drivers/keyb.h>
#include <ll/i386/cons.h>
#include <drivers/glib.h>
PID p,p1;
TASK Woop(void* arg)
{
int iCount = 0;
while(1)
{
++iCount;
if (iCount == 100)
{
cprintf(" blocking the task \n",iCount);
task_disable(p);
}
cprintf(" this is p %d \n",iCount);
task_endcycle();
}
}
TASK Woop1(void* arg)
{
int iCount = 0;
while(1)
{
++iCount;
//cprintf(" this is p1 %d \n",iCount);
if (iCount == 100)
{
}
task_endcycle();
}
}
void end_fun(KEY_EVT* k)
{
cprintf("Ending...\n");
sys_end();
}
int main(int argc, char **argv)
{
KEY_EVT k;
k.flag = 0;
k.scan = KEY_ENT;
k.ascii = ESC;
keyb_hook(k,end_fun);
SOFT_TASK_MODEL m;
soft_task_default_model(m);
soft_task_def_level(m,0);
soft_task_def_periodic(m);
//soft_task_def_save_arrivals(m);
soft_task_def_period(m,25000);
soft_task_def_wcet(m, 500);
soft_task_def_met(m,100);
p = task_create("WOO",Woop,&m,NULL);
p1 = task_create("WOO1",Woop1,&m,NULL);
task_activate(p);
task_activate(p1);
task_join(p,NULL);
}