view TaskManager/kernel/sys_task/TaskArray.cc @ 685:b386522827ae

Bulk task on going.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Dec 2009 00:32:34 +0900
parents 458a1ad91427
children 257ad1a518e3
line wrap: on
line source

#include "Finish.h"
#include "SysFunc.h"
#include "Scheduler.h"
#include "Task.h"


SchedDefineTask(TaskArray);


static int
run(SchedTask *s,void *rbuf, void *wbuf)
{
#ifdef SIMPLE_TASK

#ifdef TEST_TASK_ARRAY
    Task *task = (Task *)rbuf;
    Task *last = (Task*)(((char*)rbuf)+ s->read_size());

    s->printf("last = %lx\n"   ,(long) last);
    while( task <  last) {
	s->printf("  task = %lx\n"   ,(long) task);
	task->print();
	task = task->next();
    }
#else

    Task *task = (Task *)rbuf;
    SchedTaskArray *nextSched = createSchedTaskArray(s->get_scheduler(), task);
    s->get_scheduler()->run(nextSched); 

#endif
#endif
    return 0;
}