Microchip® Advanced Software Framework

mt.c File Reference

Implementation of the archtecture agnostic parts of the preemptive multithreading library for Contiki.

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
#include "contiki.h"
#include "sys/mt.h"
#include "sys/cc.h"

Macros

#define MT_STATE_EXITED   5
 
#define MT_STATE_READY   1
 
#define MT_STATE_RUNNING   2
 

Functions

void mt_exec (struct mt_thread *thread)
 Execute parts of a thread. More...
 
void mt_exit (void)
 Exit a thread. More...
 
void mt_init (void)
 Initializes the multithreading library. More...
 
void mt_remove (void)
 Uninstalls library and cleans up. More...
 
void mt_start (struct mt_thread *thread, void(*function)(void *), void *data)
 Starts a multithreading thread. More...
 
void mt_stop (struct mt_thread *thread)
 Stop a thread. More...
 
void mt_yield (void)
 Voluntarily give up the processor. More...
 

Variables

static struct mt_threadcurrent
 

#define MT_STATE_EXITED   5

Referenced by mt_exit().

#define MT_STATE_READY   1

Referenced by mt_exec(), mt_start(), and mt_yield().

#define MT_STATE_RUNNING   2

Referenced by mt_exec().

struct mt_thread* current
static

Referenced by print_stats().