aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-21 19:06:46 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-21 19:06:46 +0000
commitb3b1028036a2f18327fb97f2126192a2ace62bb2 (patch)
tree4266ff20b2a8b76a331572557a19e64b48f56738 /os/kernel/src
parent17f0815d52977bd1e3e9e662d2ffdccbaf77a6bd (diff)
downloadChibiOS-b3b1028036a2f18327fb97f2126192a2ace62bb2.tar.gz
ChibiOS-b3b1028036a2f18327fb97f2126192a2ace62bb2.tar.bz2
ChibiOS-b3b1028036a2f18327fb97f2126192a2ace62bb2.zip
TIME_IMMEDIATE and TIME_INFINITE values swapped.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2757 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r--os/kernel/src/chcond.c22
-rw-r--r--os/kernel/src/chschd.c4
-rw-r--r--os/kernel/src/chthreads.c6
-rw-r--r--os/kernel/src/chvt.c12
4 files changed, 21 insertions, 23 deletions
diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c
index 0ad9d459d..a6534eabc 100644
--- a/os/kernel/src/chcond.c
+++ b/os/kernel/src/chcond.c
@@ -203,11 +203,11 @@ msg_t chCondWaitS(CondVar *cp) {
* mutex, the mutex ownership is lost.
*
* @param[in] cp pointer to the @p CondVar structure
- * @param[in] time the number of ticks before the operation timeouts,
- * the special value @p TIME_INFINITE is allowed.
- * It is not possible to specify zero @p TIME_IMMEDIATE
- * as timeout specification because it would make no sense
- * in this function.
+ * @param[in] time the number of ticks before the operation timeouts, the
+ * special values are handled as follow:
+ * - @a TIME_INFINITE no timeout.
+ * - @a TIME_IMMEDIATE this value is not allowed.
+ * .
* @return A message specifying how the invoking thread has been
* released from the condition variable.
* @retval RDY_OK if the condvar has been signaled using
@@ -240,11 +240,11 @@ msg_t chCondWaitTimeout(CondVar *cp, systime_t time) {
* mutex, the mutex ownership is lost.
*
* @param[in] cp pointer to the @p CondVar structure
- * @param[in] time the number of ticks before the operation timeouts,
- * the special value @p TIME_INFINITE is allowed.
- * It is not possible to specify zero @p TIME_IMMEDIATE
- * as timeout specification because it would make no sense
- * in this function.
+ * @param[in] time the number of ticks before the operation timeouts, the
+ * special values are handled as follow:
+ * - @a TIME_INFINITE no timeout.
+ * - @a TIME_IMMEDIATE this value is not allowed.
+ * .
* @return A message specifying how the invoking thread has been
* released from the condition variable.
* @retval RDY_OK if the condvar has been signaled using
@@ -260,7 +260,7 @@ msg_t chCondWaitTimeoutS(CondVar *cp, systime_t time) {
Mutex *mp;
msg_t msg;
- chDbgCheck(cp != NULL, "chCondWaitTimeoutS");
+ chDbgCheck((cp != NULL) && (time != TIME_IMMEDIATE), "chCondWaitTimeoutS");
chDbgAssert(currp->p_mtxlist != NULL,
"chCondWaitTimeoutS(), #1",
"not owning a mutex");
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index 5b04c1f3d..85e968904 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -160,9 +160,7 @@ static void wakeup(void *p) {
* - @a TIME_INFINITE the thread enters an infinite sleep
* state, this is equivalent to invoking
* @p chSchGoSleepS() but, of course, less efficient.
- * - @a TIME_IMMEDIATE this value is accepted but
- * interpreted as a normal time specification not as an
- * immediate timeout specification.
+ * - @a TIME_IMMEDIATE this value is not allowed.
* .
* @return The wakeup message.
* @retval RDY_TIMEOUT if a timeout occurs.
diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c
index 51efc20d1..a00b5d3db 100644
--- a/os/kernel/src/chthreads.c
+++ b/os/kernel/src/chthreads.c
@@ -273,16 +273,14 @@ void chThdTerminate(Thread *tp) {
* handled as follow:
* - @a TIME_INFINITE the thread enters an infinite sleep
* state.
- * - @a TIME_IMMEDIATE this value is accepted but
- * interpreted as a normal time specification not as an
- * immediate timeout specification.
+ * - @a TIME_IMMEDIATE this value is not allowed.
* .
*
* @api
*/
void chThdSleep(systime_t time) {
- chDbgCheck(time != TIME_INFINITE, "chThdSleep");
+ chDbgCheck(time != TIME_IMMEDIATE, "chThdSleep");
chSysLock();
chThdSleepS(time);
diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c
index b622bb493..016849186 100644
--- a/os/kernel/src/chvt.c
+++ b/os/kernel/src/chvt.c
@@ -52,10 +52,12 @@ void vt_init(void) {
* the I-Locked state, see @ref system_states.
*
* @param[out] vtp the @p VirtualTimer structure pointer
- * @param[in] time the number of time ticks, the value @p TIME_INFINITE
- * is notallowed. The value @p TIME_IMMEDIATE is allowed
- * but interpreted as a normal time specification not as
- * an immediate timeout specification.
+ * @param[in] time the number of ticks before the operation timeouts, the
+ * special values are handled as follow:
+ * - @a TIME_INFINITE is allowed but interpreted as a
+ * normal time specification.
+ * - @a TIME_IMMEDIATE this value is not allowed.
+ * .
* @param[in] vtfunc the timer callback function. After invoking the
* callback the timer is disabled and the structure can
* be disposed or reused.
@@ -67,7 +69,7 @@ void vt_init(void) {
void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
VirtualTimer *p;
- chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (time != TIME_INFINITE),
+ chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (time != TIME_IMMEDIATE),
"chVTSetI");
vtp->vt_par = par;