diff options
Diffstat (limited to 'src/chmsg.c')
-rw-r--r-- | src/chmsg.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/chmsg.c b/src/chmsg.c index 844628d75..61546d7c1 100644 --- a/src/chmsg.c +++ b/src/chmsg.c @@ -66,11 +66,8 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) { chSysLock();
+ chDbgAssert(tp->p_state != PRWTMSG, "chmsg.c, chMsgSendWithEvent()");
fifo_insert(currp, &tp->p_msgqueue);
-#ifdef CH_USE_DEBUG
- if (tp->p_state == PRWTMSG)
- chDbgPanic("chmsg.c, chMsgSendWithEvent()");
-#endif
chEvtSendI(esp);
currp->p_msg = msg;
chSchGoSleepS(PRSNDMSG);
@@ -84,10 +81,7 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) { #ifdef CH_USE_MESSAGES_TIMEOUT
static void wakeup(void *p) {
-#ifdef CH_USE_DEBUG
- if (((Thread *)p)->p_state != PRSNDMSG)
- chDbgPanic("chmsg.c, wakeup()");
-#endif
+ chDbgAssert(((Thread *)p)->p_state == PRSNDMSG, "chmsg.c, wakeup()");
chSchReadyI(dequeue(p), RDY_TIMEOUT);
}
@@ -186,10 +180,7 @@ void chMsgRelease(t_msg msg) { chSysLock();
-#ifdef CH_USE_DEBUG
- if (!chMsgIsPendingI(currp))
- chDbgPanic("chmsg.c, chMsgRelease()");
-#endif
+ chDbgAssert(chMsgIsPendingI(currp), "chmsg.c, chMsgRelease()");
chSchWakeupS(fifo_remove(&currp->p_msgqueue), msg);
chSysUnlock();
|