removed unused state codes and unused printf statements

This commit is contained in:
nvt-se 2009-09-03 12:57:57 +00:00
parent 6680d2c6c2
commit a21dece53f
2 changed files with 4 additions and 12 deletions

View File

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: mt.c,v 1.6 2007/05/22 20:58:14 adamdunkels Exp $ * $Id: mt.c,v 1.7 2009/09/03 12:57:58 nvt-se Exp $
*/ */
/** /**
@ -49,8 +49,6 @@
#define MT_STATE_READY 1 #define MT_STATE_READY 1
#define MT_STATE_RUNNING 2 #define MT_STATE_RUNNING 2
#define MT_STATE_WAITING 3
#define MT_STATE_PEEK 4
#define MT_STATE_EXITED 5 #define MT_STATE_EXITED 5
static struct mt_thread *current; static struct mt_thread *current;
@ -81,13 +79,11 @@ mt_start(struct mt_thread *thread, void (* function)(void *), void *data)
void void
mt_exec(struct mt_thread *thread) mt_exec(struct mt_thread *thread)
{ {
if(thread->state == MT_STATE_READY || if(thread->state == MT_STATE_READY) {
thread->state == MT_STATE_PEEK) {
thread->state = MT_STATE_RUNNING; thread->state = MT_STATE_RUNNING;
current = thread; current = thread;
/* Switch context to the thread. The function call will not return /* Switch context to the thread. The function call will not return
until the the thread has yielded, or is preempted. */ until the the thread has yielded, or is preempted. */
/*printf("swtis\n");*/
mtarch_exec(&thread->thread); mtarch_exec(&thread->thread);
} }
} }

View File

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cooja_mt.c,v 1.1 2006/09/29 14:32:38 fros4943 Exp $ * $Id: cooja_mt.c,v 1.2 2009/09/03 12:57:57 nvt-se Exp $
*/ */
/* /*
* This file is ripped from mt.c of the Contiki Multi-threading library. * This file is ripped from mt.c of the Contiki Multi-threading library.
@ -43,8 +43,6 @@
#define MT_STATE_READY 1 #define MT_STATE_READY 1
#define MT_STATE_RUNNING 2 #define MT_STATE_RUNNING 2
#define MT_STATE_WAITING 3
#define MT_STATE_PEEK 4
#define MT_STATE_EXITED 5 #define MT_STATE_EXITED 5
static struct cooja_mt_thread *current; static struct cooja_mt_thread *current;
@ -75,13 +73,11 @@ cooja_mt_start(struct cooja_mt_thread *thread, void (* function)(void *), void *
void void
cooja_mt_exec(struct cooja_mt_thread *thread) cooja_mt_exec(struct cooja_mt_thread *thread)
{ {
if(thread->state == MT_STATE_READY || if(thread->state == MT_STATE_READY) {
thread->state == MT_STATE_PEEK) {
thread->state = MT_STATE_RUNNING; thread->state = MT_STATE_RUNNING;
current = thread; current = thread;
/* Switch context to the thread. The function call will not return /* Switch context to the thread. The function call will not return
until the the thread has yielded, or is preempted. */ until the the thread has yielded, or is preempted. */
/*printf("swtis\n");*/
cooja_mtarch_exec(&thread->thread); cooja_mtarch_exec(&thread->thread);
} }
} }