aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-09-03 10:58:43 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-09-03 10:58:43 +0000
commitd1ffba4de3c102f20a1985a7c5576a9627bd5287 (patch)
tree336c37c1d45192161175b8371678e0470486f8fe
parent090b4c11096363cf25ba9c4ea2a788cae1d7e8a4 (diff)
downloadChibiOS-d1ffba4de3c102f20a1985a7c5576a9627bd5287.tar.gz
ChibiOS-d1ffba4de3c102f20a1985a7c5576a9627bd5287.tar.bz2
ChibiOS-d1ffba4de3c102f20a1985a7c5576a9627bd5287.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@420 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--readme.txt5
-rw-r--r--src/chthreads.c21
-rw-r--r--src/include/threads.h2
3 files changed, 9 insertions, 19 deletions
diff --git a/readme.txt b/readme.txt
index 8b4c14fad..3b01853f4 100644
--- a/readme.txt
+++ b/readme.txt
@@ -89,6 +89,11 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
use the allocation services internally, it is up to the application code
to use the allocators in order to use dynamic system objects.
Both the allocators can be disabled and removed from the memory image.
+- FIX: Corrected the wrong definition of the chThdResumeI() macro.
+- CHANGE: Now the chThdResume() asserts that the thread is in PRSUSPEND state
+ rather than test it.
+- CHANGE: Removed the CH_USE_SUSPEND and CH_USE_RESUME configuration options
+ in order to make the chconf.h file simpler.
- Added new test cases to the test suite.
*** 0.6.10 ***
diff --git a/src/chthreads.c b/src/chthreads.c
index 4dc8be79d..e95abbe73 100644
--- a/src/chthreads.c
+++ b/src/chthreads.c
@@ -173,7 +173,6 @@ void chThdSetPriority(tprio_t newprio) {
chSysUnlock();
}
-#ifdef CH_USE_SUSPEND
/**
* Suspends the invoking thread.
*
@@ -182,42 +181,28 @@ void chThdSetPriority(tprio_t newprio) {
* \p PRSUSPENDED state, it is set to \p NULL after it is resumed.
* This allows to implement a "test and resume" on the variable
* into interrupt handlers.
- * @note The function is available only if the \p CH_USE_SUSPEND
- * option is enabled in \p chconf.h.
*/
void chThdSuspend(Thread **tpp) {
chSysLock();
-
chDbgAssert(*tpp == NULL, "chthreads.c, chThdSuspend()");
*tpp = currp;
chSchGoSleepS(PRSUSPENDED);
*tpp = NULL;
-
chSysUnlock();
}
-#endif /* CH_USE_SUSPEND */
-#ifdef CH_USE_RESUME
/**
- * Resumes a thread created with the \p P_SUSPENDED option or suspended with
- * \p chThdSuspend().
+ * Resumes a suspended thread.
* @param tp the pointer to the thread
- * @note The function has no effect on threads in any other state than
- * \p PRSUSPENDED.
- * @note The function is available only if the \p CH_USE_RESUME
- * option is enabled in \p chconf.h.
*/
void chThdResume(Thread *tp) {
chSysLock();
-
- if ((tp)->p_state == PRSUSPENDED)
- chSchWakeupS(tp, RDY_OK);
-
+ chDbgAssert(tp->p_state == PRSUSPENDED, "chthreads.c, chThdResume()");
+ chSchWakeupS(tp, RDY_OK);
chSysUnlock();
}
-#endif
#ifdef CH_USE_TERMINATE
/**
diff --git a/src/include/threads.h b/src/include/threads.h
index 1572417d6..b74ba60b4 100644
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -239,7 +239,7 @@ extern "C" {
* \p chThdSuspend().
* @param tp the pointer to the thread
*/
-#define chThdResumeI(tp) chSchReadyI((tp), RDY_OK)
+#define chThdResumeI(tp) chSchReadyI(tp)
#endif /* _THREADS_H_ */