odyssey/src/mm_machine.h

29 lines
538 B
C
Raw Normal View History

2017-05-24 11:04:19 +00:00
#ifndef MM_MACHINE_H
#define MM_MACHINE_H
/*
* machinarium.
*
* cooperative multitasking engine.
*/
2017-05-24 11:04:19 +00:00
typedef struct mm_machine mm_machine_t;
2017-05-24 11:04:19 +00:00
struct mm_machine
{
2017-05-27 12:23:06 +00:00
int online;
uint64_t id;
char *name;
machine_function_t main;
void *main_arg;
mm_thread_t thread;
mm_scheduler_t scheduler;
mm_condition_cache_t condition_cache;
mm_loop_t loop;
mm_list_t link;
};
extern __thread mm_machine_t *mm_self;
2017-05-24 11:04:19 +00:00
#endif /* MM_MACHINE_H */