diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-20 10:46:51 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-20 10:46:51 +0000 |
commit | b0bdd6eff685c2d678a052ebb1a0e9fa5512aaac (patch) | |
tree | c5095c501e475e2e35eee9f4d918774ea671b0d5 /os/kernel/src/chevents.c | |
parent | 0d717a5f9fe78ad4857677baf9d0000c2304a6ca (diff) | |
download | ChibiOS-b0bdd6eff685c2d678a052ebb1a0e9fa5512aaac.tar.gz ChibiOS-b0bdd6eff685c2d678a052ebb1a0e9fa5512aaac.tar.bz2 ChibiOS-b0bdd6eff685c2d678a052ebb1a0e9fa5512aaac.zip |
Fixed bug 3113443.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2392 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chevents.c')
-rw-r--r-- | os/kernel/src/chevents.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c index a66a7fa28..a0ef2d1bb 100644 --- a/os/kernel/src/chevents.c +++ b/os/kernel/src/chevents.c @@ -382,11 +382,15 @@ eventmask_t chEvtWaitOneTimeout(eventmask_t mask, systime_t time) { chSysLock();
if ((m = (ctp->p_epending & mask)) == 0) {
- if (TIME_IMMEDIATE == time)
+ if (TIME_IMMEDIATE == time) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
ctp->p_u.ewmask = mask;
- if (chSchGoSleepTimeoutS(THD_STATE_WTOREVT, time) < RDY_OK)
+ if (chSchGoSleepTimeoutS(THD_STATE_WTOREVT, time) < RDY_OK) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
m = ctp->p_epending & mask;
}
m &= -m;
@@ -421,11 +425,15 @@ eventmask_t chEvtWaitAnyTimeout(eventmask_t mask, systime_t time) { chSysLock();
if ((m = (ctp->p_epending & mask)) == 0) {
- if (TIME_IMMEDIATE == time)
+ if (TIME_IMMEDIATE == time) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
ctp->p_u.ewmask = mask;
- if (chSchGoSleepTimeoutS(THD_STATE_WTOREVT, time) < RDY_OK)
+ if (chSchGoSleepTimeoutS(THD_STATE_WTOREVT, time) < RDY_OK) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
m = ctp->p_epending & mask;
}
ctp->p_epending &= ~m;
@@ -457,11 +465,15 @@ eventmask_t chEvtWaitAllTimeout(eventmask_t mask, systime_t time) { chSysLock();
if ((ctp->p_epending & mask) != mask) {
- if (TIME_IMMEDIATE == time)
+ if (TIME_IMMEDIATE == time) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
ctp->p_u.ewmask = mask;
- if (chSchGoSleepTimeoutS(THD_STATE_WTANDEVT, time) < RDY_OK)
+ if (chSchGoSleepTimeoutS(THD_STATE_WTANDEVT, time) < RDY_OK) {
+ chSysUnlock();
return (eventmask_t)0;
+ }
}
ctp->p_epending &= ~mask;
|