aboutsummaryrefslogtreecommitdiffstats
path: root/src/chmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chmsg.c')
-rw-r--r--src/chmsg.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/chmsg.c b/src/chmsg.c
index 010da86e5..5ea3f9821 100644
--- a/src/chmsg.c
+++ b/src/chmsg.c
@@ -80,10 +80,12 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) {
#endif
#ifdef CH_USE_MESSAGES_TIMEOUT
-static void unsend(void *p) {
+static void wakeup(void *p) {
-// Test removed, it should never happen.
-// if (((Thread *)p)->p_state == PRSNDMSG)
+#ifdef CH_USE_DEBUG
+ if (((Thread *)p)->p_state != PRSNDMSG)
+ chDbgPanic("chmsg.c, wakeup()\r\n");
+#endif
chSchReadyI(dequeue(p))->p_rdymsg = RDY_TIMEOUT;
}
@@ -108,7 +110,7 @@ t_msg chMsgSendTimeout(Thread *tp, t_msg msg, t_time time) {
chSysLock();
- chVTSetI(&vt, time, unsend, currp);
+ chVTSetI(&vt, time, wakeup, currp);
fifo_insert(currp, &tp->p_msgqueue);
if (tp->p_state == PRWTMSG)
chSchReadyI(tp);