From 320ea5a58a7eb95177ddfde8f79096ea4f5360e1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 23 Nov 2007 22:14:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@110 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chthreads.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/chthreads.c b/src/chthreads.c index f58e58ebe..a0729311f 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -195,7 +195,7 @@ void chThdExit(t_msg msg) { chSysLock(); - currp->p_exitcode = msg; /* Post mortem info. */ + currp->p_exitcode = msg; #ifdef CH_USE_WAITEXIT while (notempty(&currp->p_waiting)) chSchReadyI(list_remove(&currp->p_waiting), RDY_OK); @@ -204,8 +204,6 @@ void chThdExit(t_msg msg) { chEvtSendI(&currp->p_exitesource); #endif chSchGoSleepS(PREXIT); - - chSysUnlock(); /* Never executed. */ } #ifdef CH_USE_WAITEXIT @@ -218,6 +216,7 @@ void chThdExit(t_msg msg) { * option is enabled in \p chconf.h. */ t_msg chThdWait(Thread *tp) { + t_msg msg; chSysLock(); @@ -225,9 +224,10 @@ t_msg chThdWait(Thread *tp) { list_insert(currp, &tp->p_waiting); chSchGoSleepS(PRWAIT); } + msg = tp->p_exitcode; chSysUnlock(); - return tp->p_exitcode; + return msg; } #endif /* CH_USE_WAITEXIT */ -- cgit v1.2.3