aboutsummaryrefslogtreecommitdiffstats
path: root/src/chmsg.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-01-07 14:06:46 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-01-07 14:06:46 +0000
commitb1db8a9f7fe3bc2cd48c52e7c2c50e0e118f8889 (patch)
treec291c85d4435b20ee8f92d2726f74f7951ad1d52 /src/chmsg.c
parent14d3b059c225769038a0f3538f491cf6099dbb3e (diff)
downloadChibiOS-b1db8a9f7fe3bc2cd48c52e7c2c50e0e118f8889.tar.gz
ChibiOS-b1db8a9f7fe3bc2cd48c52e7c2c50e0e118f8889.tar.bz2
ChibiOS-b1db8a9f7fe3bc2cd48c52e7c2c50e0e118f8889.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@166 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chmsg.c')
-rw-r--r--src/chmsg.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/chmsg.c b/src/chmsg.c
index 61546d7c1..20a59904e 100644
--- a/src/chmsg.c
+++ b/src/chmsg.c
@@ -36,7 +36,14 @@ t_msg chMsgSend(Thread *tp, t_msg msg) {
chSysLock();
+#ifdef CH_USE_MESSAGES_PRIORITY
+ if (tp->p_flags & P_MSGBYPRIO)
+ prio_insert(currp, &tp->p_msgqueue);
+ else
+ fifo_insert(currp, &tp->p_msgqueue);
+#else
fifo_insert(currp, &tp->p_msgqueue);
+#endif
currp->p_msg = msg;
if (tp->p_state == PRWTMSG)
chSchReadyI(tp, RDY_OK);
@@ -67,7 +74,14 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) {
chSysLock();
chDbgAssert(tp->p_state != PRWTMSG, "chmsg.c, chMsgSendWithEvent()");
+#ifdef CH_USE_MESSAGES_PRIORITY
+ if (tp->p_flags & P_MSGBYPRIO)
+ prio_insert(currp, &tp->p_msgqueue);
+ else
+ fifo_insert(currp, &tp->p_msgqueue);
+#else
fifo_insert(currp, &tp->p_msgqueue);
+#endif
chEvtSendI(esp);
currp->p_msg = msg;
chSchGoSleepS(PRSNDMSG);
@@ -107,7 +121,14 @@ t_msg chMsgSendTimeout(Thread *tp, t_msg msg, t_time time) {
chSysLock();
chVTSetI(&vt, time, wakeup, currp);
+#ifdef CH_USE_MESSAGES_PRIORITY
+ if (tp->p_flags & P_MSGBYPRIO)
+ prio_insert(currp, &tp->p_msgqueue);
+ else
+ fifo_insert(currp, &tp->p_msgqueue);
+#else
fifo_insert(currp, &tp->p_msgqueue);
+#endif
if (tp->p_state == PRWTMSG)
chSchReadyI(tp, RDY_OK);
currp->p_msg = msg;