diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-12 16:38:58 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-12 16:38:58 +0000 |
commit | d76f6bff4f7561f6cf071108b8db5756fe9a3909 (patch) | |
tree | ed9e0daa7256d9293f1dca19c4dcc91f12c6c3ac /src | |
parent | 9d69c31143d011b0345598a6c1e4732c0f2a736e (diff) | |
download | ChibiOS-d76f6bff4f7561f6cf071108b8db5756fe9a3909.tar.gz ChibiOS-d76f6bff4f7561f6cf071108b8db5756fe9a3909.tar.bz2 ChibiOS-d76f6bff4f7561f6cf071108b8db5756fe9a3909.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@227 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r-- | src/chsem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/chsem.c b/src/chsem.c index 6953fb846..14b8567ad 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -174,8 +174,13 @@ void chSemSignal(Semaphore *sp) { */
void chSemSignalI(Semaphore *sp) {
- if (sp->s_cnt++ < 0)
- chSchReadyI(fifo_remove(&sp->s_queue))->p_rdymsg = RDY_OK;
+ if (sp->s_cnt++ < 0) {
+ /* NOTE: It is done this way in order to allow a tail call on
+ chSchReadyI().*/
+ Thread *tp = fifo_remove(&sp->s_queue);
+ tp->p_rdymsg = RDY_OK;
+ chSchReadyI(tp);
+ }
}
#ifdef CH_USE_SEMSW
|