From ba030d32c3e65ec5d4c6c6eaf7f55d7c61aae0b8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Jan 2008 13:41:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@170 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chmsg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/chmsg.c') diff --git a/src/chmsg.c b/src/chmsg.c index 20a59904e..ef8b111dc 100644 --- a/src/chmsg.c +++ b/src/chmsg.c @@ -45,6 +45,7 @@ t_msg chMsgSend(Thread *tp, t_msg msg) { fifo_insert(currp, &tp->p_msgqueue); #endif currp->p_msg = msg; + currp->p_wtthdp = tp; if (tp->p_state == PRWTMSG) chSchReadyI(tp, RDY_OK); chSchGoSleepS(PRSNDMSG); @@ -83,6 +84,7 @@ t_msg chMsgSendWithEvent(Thread *tp, t_msg msg, EventSource *esp) { fifo_insert(currp, &tp->p_msgqueue); #endif chEvtSendI(esp); + currp->p_wtthdp = tp; currp->p_msg = msg; chSchGoSleepS(PRSNDMSG); msg = currp->p_rdymsg; @@ -129,9 +131,10 @@ t_msg chMsgSendTimeout(Thread *tp, t_msg msg, t_time time) { #else fifo_insert(currp, &tp->p_msgqueue); #endif + currp->p_msg = msg; + currp->p_wtthdp = tp; if (tp->p_state == PRWTMSG) chSchReadyI(tp, RDY_OK); - currp->p_msg = msg; chSchGoSleepS(PRSNDMSG); msg = currp->p_rdymsg; if (chVTIsArmedI(&vt)) -- cgit v1.2.3