Mercurial > hg > Game > CbCTaskManager
view Task.h @ 6:51c3a631a7bc
add taskinit.
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 25 Dec 2009 17:55:24 +0900 |
parents | 5a3e2b0622fd |
children |
line wrap: on
line source
#ifndef _TASK_H #define _TASK_H // included by user. #include "List.h" #include "interface.h" #define F_NONE 0x000 #define F_STARTER 0x001 #define F_a 0x002 #define F_b 0x004 typedef struct _TaskType { Taskrun code; char *name; unsigned int flag; // F_STARTER .. } TaskType; /* defined by user automatically. */ extern const TaskType tasktypes[]; extern const int max_tasktype; enum cpu { ANY = 0, // not implemented yet. MAIN, SUB, }; /* C++CeriumでのHTaskにあたるのかな */ typedef struct _Task { char *name; // task name. int typeid; // index of tasktypes array. int id; // task identifier. void *rbuff; void *wbuff; int rsize; int wsize; List *waiter; // List of tasks waiting for me :-P List *waitee; // List of tasks keep me waiting :-( enum cpu cpu; } Task; /* user interfaces. */ extern Task * createTask (int, char *); extern void taskSetData (Task *, void *, int, void *, int); extern void taskSetWait (Task *, Task *); #endif /* _TASK_H */