odyssey/src/mm.c

32 lines
575 B
C
Raw Normal View History

2017-03-21 09:47:32 +00:00
/*
* machinarium.
*
2017-03-21 09:47:32 +00:00
* cooperative multitasking engine.
*/
#include <machinarium.h>
#include <machinarium_private.h>
mm_t machinarium;
2017-03-21 09:47:32 +00:00
MACHINE_API int
machinarium_init(void)
{
mm_machinemgr_init(&machinarium.machine_mgr);
2017-05-19 11:17:58 +00:00
mm_msgpool_init(&machinarium.msg_pool);
mm_tls_init();
2017-05-23 12:34:35 +00:00
mm_taskmgr_init(&machinarium.task_mgr);
mm_taskmgr_start(&machinarium.task_mgr, 3);
return 0;
}
MACHINE_API void
machinarium_free(void)
{
2017-05-23 12:34:35 +00:00
mm_taskmgr_stop(&machinarium.task_mgr);
mm_machinemgr_free(&machinarium.machine_mgr);
2017-05-19 11:17:58 +00:00
mm_msgpool_free(&machinarium.msg_pool);
mm_tls_free();
}