40 #include "sys/cooja_mt.h"
43 #define MT_STATE_READY 1
44 #define MT_STATE_RUNNING 2
45 #define MT_STATE_EXITED 5
47 static struct cooja_mt_thread *current;
59 cooja_mtarch_remove();
63 cooja_mt_start(
struct cooja_mt_thread *thread,
void (*
function)(
void *),
void *data)
67 cooja_mtarch_start(&thread->thread,
function, data);
69 thread->state = MT_STATE_READY;
73 cooja_mt_exec(
struct cooja_mt_thread *thread)
75 if(thread->state == MT_STATE_READY) {
76 thread->state = MT_STATE_RUNNING;
80 cooja_mtarch_exec(&thread->thread);
87 current->state = MT_STATE_EXITED;
95 current->state = MT_STATE_READY;
101 cooja_mtarch_yield();
#define NULL
The null pointer.
Default definitions of C compiler quirk work-arounds.