diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-11 16:42:20 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-11 16:42:20 +0000 |
commit | 869cacb3d442841c83034736e1f1702fc9bb2d8e (patch) | |
tree | b555a8ee87081ec068929e1bdd082319744f7153 /src | |
parent | 88c256ae5265f5d6a7ffa25dc17f693e036256bf (diff) | |
download | ChibiOS-869cacb3d442841c83034736e1f1702fc9bb2d8e.tar.gz ChibiOS-869cacb3d442841c83034736e1f1702fc9bb2d8e.tar.bz2 ChibiOS-869cacb3d442841c83034736e1f1702fc9bb2d8e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@223 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r-- | src/chschd.c | 5 | ||||
-rw-r--r-- | src/include/threads.h | 24 |
2 files changed, 14 insertions, 15 deletions
diff --git a/src/chschd.c b/src/chschd.c index b7f52c96d..7c45e009e 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -24,7 +24,7 @@ #include <ch.h>
-/** @cond never*/
+/** @cond never */
ReadyList rlist;
/** @endcond */
@@ -58,10 +58,11 @@ INLINE void chSchReadyI(Thread *tp, msg_t msg) { #else
void chSchReadyI(Thread *tp, msg_t msg) {
#endif
- Thread *cp = rlist.r_queue.p_next;
+ Thread *cp;
tp->p_state = PRREADY;
tp->p_rdymsg = msg;
+ cp = rlist.r_queue.p_next;
while (cp->p_prio >= tp->p_prio)
cp = cp->p_next;
/* Insertion on p_prev.*/
diff --git a/src/include/threads.h b/src/include/threads.h index 11674b322..d9bb467b9 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -107,30 +107,28 @@ struct Thread { #endif
};
-/** Thread state: Reserved.*/
-#define PRFREE 0
+/** Thread state: Thread in the ready list.*/
+#define PRREADY 0
/** Thread state: Current.*/
#define PRCURR 1
-/** Thread state: Thread in the ready list.*/
-#define PRREADY 2
/** Thread state: Thread created in suspended state.*/
-#define PRSUSPENDED 3
+#define PRSUSPENDED 2
/** Thread state: Waiting on a semaphore.*/
-#define PRWTSEM 4
+#define PRWTSEM 3
/** Thread state: Waiting on a mutex.*/
-#define PRWTMTX 5
+#define PRWTMTX 4
/** Thread state: Waiting in \p chThdSleep() or \p chThdSleepUntil().*/
-#define PRSLEEP 6
+#define PRSLEEP 5
/** Thread state: Waiting in \p chThdWait().*/
-#define PRWAIT 7
+#define PRWAIT 6
/** Thread state: Waiting in \p chEvtWait().*/
-#define PRWTEVENT 8
+#define PRWTEVENT 7
/** Thread state: Waiting in \p chMsgSend().*/
-#define PRSNDMSG 9
+#define PRSNDMSG 8
/** Thread state: Waiting in \p chMsgWait().*/
-#define PRWTMSG 10
+#define PRWTMSG 9
/** Thread state: After termination.*/
-#define PREXIT 11
+#define PREXIT 10
#ifdef CH_USE_TERMINATE
/** Thread option: Termination requested flag.*/
|