diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-23 22:14:30 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-23 22:14:30 +0000 |
commit | 320ea5a58a7eb95177ddfde8f79096ea4f5360e1 (patch) | |
tree | daa86a647c1038278f61d4a450bea600935e15e3 /src/chthreads.c | |
parent | 0f22fb555eeada81e080232e465d273289d48c83 (diff) | |
download | ChibiOS-320ea5a58a7eb95177ddfde8f79096ea4f5360e1.tar.gz ChibiOS-320ea5a58a7eb95177ddfde8f79096ea4f5360e1.tar.bz2 ChibiOS-320ea5a58a7eb95177ddfde8f79096ea4f5360e1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@110 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chthreads.c')
-rw-r--r-- | src/chthreads.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 */
|