git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@529 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-12-06 10:59:44 +00:00
parent 87befad254
commit d8b450d8a0
4 changed files with 47 additions and 37 deletions

View File

@ -1,5 +1,5 @@
*************************************************************************** ***************************************************************************
Kernel: ChibiOS/RT 0.8.0 Kernel: ChibiOS/RT 0.8.2
Compiler: GCC 3.2.3 (MSPGCC) Compiler: GCC 3.2.3 (MSPGCC)
Options: -O2 -fomit-frame-pointer Options: -O2 -fomit-frame-pointer
Settings: MCLK=DCOCLK 750Khz Settings: MCLK=DCOCLK 750Khz
@ -65,11 +65,11 @@ Settings: MCLK=DCOCLK 750Khz
--- Result: SUCCESS --- Result: SUCCESS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Test Case 19 (Benchmark, threads creation/termination, worst case) --- Test Case 19 (Benchmark, threads creation/termination, worst case)
--- Score : 1166 threads/S --- Score : 1236 threads/S
--- Result: SUCCESS --- Result: SUCCESS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Test Case 20 (Benchmark, threads creation/termination, optimal) --- Test Case 20 (Benchmark, threads creation/termination, optimal)
--- Score : 1537 threads/S --- Score : 1560 threads/S
--- Result: SUCCESS --- Result: SUCCESS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Test Case 21 (Benchmark, mass reschedulation, 5 threads) --- Test Case 21 (Benchmark, mass reschedulation, 5 threads)
@ -84,3 +84,5 @@ Settings: MCLK=DCOCLK 750Khz
--- Score : 5632 timers/S --- Score : 5632 timers/S
--- Result: SUCCESS --- Result: SUCCESS
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Final result: SUCCESS

View File

@ -18,7 +18,7 @@
./ext/ - External libraries or other code not part of ./ext/ - External libraries or other code not part of
ChibiOS/RT but used in the demo applications. ChibiOS/RT but used in the demo applications.
./test/ - Test code, used by some demos. ./test/ - Test code, used by some demos.
./docs/Doxifile - Doxigen project file. ./docs/Doxyfile - Doxygen project file.
./docs/html/index.html - ChibiOS/RT documentation (after running doxigen). ./docs/html/index.html - ChibiOS/RT documentation (after running doxigen).
The documentation is also available on the project The documentation is also available on the project
web page: http://chibios.sourceforge.net/ web page: http://chibios.sourceforge.net/
@ -74,11 +74,14 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
***************************************************************************** *****************************************************************************
*** 0.8.2 *** *** 0.8.2 ***
- FIX: Included the files that were missing from version 0.8.1 distribution.
- FIX: Duplicated sections in the documentation removed. - FIX: Duplicated sections in the documentation removed.
- FIX: Minor problem in Cortex-M3 and AVR ports when the kernel is compiled - FIX: Minor problem in Cortex-M3 and AVR ports when the kernel is compiled
using G++. using G++.
- NEW: Added chPoolAllocI() and chPoolFreeI() APIs in order to allow the use - NEW: Added chPoolAllocI() and chPoolFreeI() APIs in order to allow the use
of memory pools from interrupt handlers and timer callbacks. of memory pools from interrupt handlers and timer callbacks.
- CHANGE: Simplified the code for chThdWait(), it is now both smaller and
faster. Added an important usage note to the documentation of this API.
- CHANGE: The macros WorkingArea(), UserStackSize() and StackAlign() are now - CHANGE: The macros WorkingArea(), UserStackSize() and StackAlign() are now
deprecated and will be removed in version 1.0.0. Use the new equivalents deprecated and will be removed in version 1.0.0. Use the new equivalents
WORKING_AREA(), THD_WA_SIZE() and STACK_ALIGN() instead. WORKING_AREA(), THD_WA_SIZE() and STACK_ALIGN() instead.

View File

@ -40,7 +40,7 @@ Thread *init_thread(Thread *tp, tprio_t prio) {
tp->p_mtxlist = NULL; tp->p_mtxlist = NULL;
#endif #endif
#ifdef CH_USE_WAITEXIT #ifdef CH_USE_WAITEXIT
list_init(&tp->p_waiting); tp->p_waiting = NULL;
#endif #endif
#ifdef CH_USE_MESSAGES #ifdef CH_USE_MESSAGES
queue_init(&tp->p_msgqueue); queue_init(&tp->p_msgqueue);
@ -324,8 +324,10 @@ void chThdExit(msg_t msg) {
tp->p_exitcode = msg; tp->p_exitcode = msg;
THREAD_EXT_EXIT(tp); THREAD_EXT_EXIT(tp);
#ifdef CH_USE_WAITEXIT #ifdef CH_USE_WAITEXIT
while (notempty(&tp->p_waiting)) // while (notempty(&tp->p_waiting))
chSchReadyI(list_remove(&tp->p_waiting)); // chSchReadyI(list_remove(&tp->p_waiting));
if (tp->p_waiting != NULL)
chSchReadyI(tp->p_waiting);
#endif #endif
#ifdef CH_USE_EXIT_EVENT #ifdef CH_USE_EXIT_EVENT
chEvtBroadcastI(&tp->p_exitesource); chEvtBroadcastI(&tp->p_exitesource);
@ -354,14 +356,21 @@ void chThdExit(msg_t msg) {
* must not be used as parameter for further system calls. * must not be used as parameter for further system calls.
* @note The function is available only if the \p CH_USE_WAITEXIT * @note The function is available only if the \p CH_USE_WAITEXIT
* option is enabled in \p chconf.h. * option is enabled in \p chconf.h.
* @note Only one thread can be waiting for another thread at any time. You
* should imagine the threads as having a reference counter that is set
* to one when the thread is created, chThdWait() decreases the reference
* and the memory is freed when the counter reaches zero. In the current
* implementation there is no real reference counter in the thread
* structure but it is a planned extension.
*/ */
msg_t chThdWait(Thread *tp) { msg_t chThdWait(Thread *tp) {
msg_t msg; msg_t msg;
chSysLock(); chSysLock();
chDbgAssert((tp != NULL) && (tp != currp), "chthreads.c, chThdWait()"); chDbgAssert((tp != NULL) && (tp != currp) && (tp->p_waiting != NULL),
"chthreads.c, chThdWait()");
if (tp->p_state != PREXIT) { if (tp->p_state != PREXIT) {
list_insert(currp, &tp->p_waiting); tp->p_waiting = currp;
chSchGoSleepS(PRWAIT); chSchGoSleepS(PRWAIT);
} }
msg = tp->p_exitcode; msg = tp->p_exitcode;
@ -369,12 +378,8 @@ msg_t chThdWait(Thread *tp) {
chSysUnlock(); chSysUnlock();
return msg; return msg;
#else /* CH_USE_DYNAMIC */ #else /* CH_USE_DYNAMIC */
if (notempty(&tp->p_waiting)) {
chSysUnlock();
return msg;
}
/* This is the last thread waiting for termination, returning memory.*/ /* Returning memory.*/
tmode_t mode = tp->p_flags & P_MEM_MODE_MASK; tmode_t mode = tp->p_flags & P_MEM_MODE_MASK;
chSysUnlock(); chSysUnlock();

View File

@ -92,7 +92,7 @@ struct Thread {
*/ */
#ifdef CH_USE_WAITEXIT #ifdef CH_USE_WAITEXIT
/** The list of the threads waiting for this thread termination. */ /** The list of the threads waiting for this thread termination. */
ThreadsList p_waiting; Thread *p_waiting;
#endif #endif
#ifdef CH_USE_EXIT_EVENT #ifdef CH_USE_EXIT_EVENT
/** The thread termination \p EventSource. */ /** The thread termination \p EventSource. */