41 #include "sys/cooja_mt.h"
44 #define MT_STATE_READY 1
45 #define MT_STATE_RUNNING 2
46 #define MT_STATE_EXITED 5
48 static struct cooja_mt_thread *current;
60 cooja_mtarch_remove();
64 cooja_mt_start(
struct cooja_mt_thread *thread,
void (*
function)(
void *),
void *data)
68 cooja_mtarch_start(&thread->thread,
function, data);
70 thread->state = MT_STATE_READY;
74 cooja_mt_exec(
struct cooja_mt_thread *thread)
76 if(thread->state == MT_STATE_READY) {
77 thread->state = MT_STATE_RUNNING;
81 cooja_mtarch_exec(&thread->thread);
88 current->state = MT_STATE_EXITED;
96 current->state = MT_STATE_READY;
102 cooja_mtarch_yield();