From e15738df0bb84657d28eb1fe11af129eb8def72f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 20 Nov 2010 10:49:42 +0000 Subject: [PATCH] Fixed bug 3113443. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_2.0.x@2393 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile | 2 +- os/kernel/include/ch.h | 4 ++-- os/kernel/src/chevents.c | 24 ++++++++++++++++++------ readme.txt | 3 +++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/Doxyfile b/docs/Doxyfile index e2be5c466..b6ffd91f7 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = ChibiOS/RT # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.0.6 +PROJECT_NUMBER = 2.0.7 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index fb5956f1a..b37d7070f 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -46,7 +46,7 @@ /** * @brief Kernel version string. */ -#define CH_KERNEL_VERSION "2.0.6" +#define CH_KERNEL_VERSION "2.0.7" /** * @brief Kernel version major number. @@ -61,7 +61,7 @@ /** * @brief Kernel version patch number. */ -#define CH_KERNEL_PATCH 6 +#define CH_KERNEL_PATCH 7 /* * Common values. diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c index 39696d981..fb3fd1c75 100644 --- a/os/kernel/src/chevents.c +++ b/os/kernel/src/chevents.c @@ -349,11 +349,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; @@ -386,11 +390,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; @@ -419,11 +427,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; diff --git a/readme.txt b/readme.txt index a0fbe72ef..8e3cedfaf 100644 --- a/readme.txt +++ b/readme.txt @@ -58,6 +58,9 @@ *** Releases *** ***************************************************************************** +*** 2.0.7 *** +- FIX: Fixed defective event wait functions with timeout (bug 3113443). + *** 2.0.6 *** - FIX: Fixed typo in memstreams.h (bug 3089567). - FIX: Fixed wrong macro check in LPC214x and AT91SAM7 serial drivers (bug