2017-05-17 11:49:52 +00:00
|
|
|
#ifndef MM_MACHINE_H_
|
|
|
|
#define MM_MACHINE_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* machinarium.
|
|
|
|
*
|
|
|
|
* cooperative multitasking engine.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct mm_machine_t mm_machine_t;
|
|
|
|
|
|
|
|
struct mm_machine_t {
|
2017-05-17 14:20:04 +00:00
|
|
|
int online;
|
|
|
|
int id;
|
2017-05-17 14:35:55 +00:00
|
|
|
char *name;
|
2017-05-17 14:20:04 +00:00
|
|
|
machine_function_t main;
|
|
|
|
void *main_arg;
|
|
|
|
mm_thread_t thread;
|
|
|
|
mm_scheduler_t scheduler;
|
2017-05-24 10:38:00 +00:00
|
|
|
mm_queuerdcache_t queuerd_cache;
|
2017-05-17 14:20:04 +00:00
|
|
|
mm_loop_t loop;
|
|
|
|
mm_list_t link;
|
2017-05-17 11:49:52 +00:00
|
|
|
};
|
|
|
|
|
2017-05-17 14:20:04 +00:00
|
|
|
extern __thread mm_machine_t *mm_self;
|
|
|
|
|
2017-05-17 11:49:52 +00:00
|
|
|
#endif
|