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

This commit is contained in:
gdisirio 2008-12-28 10:07:46 +00:00
parent dd39b808ac
commit 3e9765e206
16 changed files with 54 additions and 216 deletions

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_EVENT //#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
//#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
//#define CH_USE_QUEUES //#define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -89,18 +89,10 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/

View File

@ -84,19 +84,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY //#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -74,11 +74,17 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
***************************************************************************** *****************************************************************************
*** 1.0.0 RC1 *** *** 1.0.0 RC1 ***
- FIX: Disabled the configuration option CH_USE_MESSAGES_PRIORITY from the
MSP430 demo, the default for this option should be off.
- Removed deprecated APIs: chThdCreate() and chThdCreateFast(), removed some
references to those APIs from the test suite.
- Removed deprecated configuration feature CH_USE_EXIT_EVENT and the related
API chThdGetExitEventSource().
- Added usage note into the readme of the MinGW demo. - Added usage note into the readme of the MinGW demo.
*** 0.8.3 *** *** 0.8.3 ***
- NEW: Introduced new API chThdSleepS() as a macro, no real changes in the - NEW: Introduced new API chThdSleepS() as a macro, no real changes in the
kernel code. kernel code.
- FIX: The MinGW simulated demo now works again after breaking in 0.8.2 - FIX: The MinGW simulated demo now works again after breaking in 0.8.2
because the changes to the macro names. because the changes to the macro names.
- FIX: Adjusted the test suite stack sizes for the MinGW simulated demo, now - FIX: Adjusted the test suite stack sizes for the MinGW simulated demo, now

View File

@ -181,39 +181,6 @@ Thread *chThdCreateFromMemoryPool(MemoryPool *mp, tprio_t prio,
} }
#endif /* defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_MEMPOOLS) */ #endif /* defined(CH_USE_DYNAMIC) && defined(CH_USE_WAITEXIT) && defined(CH_USE_MEMPOOLS) */
/**
* Creates a new thread.
* @param prio the priority level for the new thread. Usually the threads are
* created with priority \p NORMALPRIO, priorities
* can range from \p LOWPRIO to \p HIGHPRIO.
* @param mode the creation option flags for the thread. The following options
* can be OR'ed in this parameter:<br>
* <ul>
* <li>\p P_SUSPENDED, the thread is created in the
* \p PRSUSPENDED state and a subsequent call to
* \p chThdResume() will make it ready for
* execution.</li>
* </ul>
* @param workspace pointer to a working area dedicated to the thread stack
* @param wsize size of the working area.
* @param pf the thread function
* @param arg an argument passed to the thread function. It can be \p NULL.
* @return The pointer to the \p Thread structure allocated for the
* thread into the working space area.
* @note A thread can terminate by calling \p chThdExit() or by simply
* returning from its main function.
* @deprecated Please use \p chThdCreateStatic() or \p chThdInit() instead,
* this function will be removed in version 1.0.0.
*/
Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace,
size_t wsize, tfunc_t pf, void *arg) {
Thread *tp = chThdInit(workspace, wsize, prio, pf, arg);
if (mode & P_SUSPENDED)
return tp;
return chThdResume(tp);
}
/** /**
* Changes the running thread priority, reschedules if necessary. * Changes the running thread priority, reschedules if necessary.
* *
@ -324,13 +291,8 @@ 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))
// chSchReadyI(list_remove(&tp->p_waiting));
if (tp->p_waiting != NULL) if (tp->p_waiting != NULL)
chSchReadyI(tp->p_waiting); chSchReadyI(tp->p_waiting);
#endif
#ifdef CH_USE_EXIT_EVENT
chEvtBroadcastI(&tp->p_exitesource);
#endif #endif
chSchGoSleepS(PREXIT); chSchGoSleepS(PREXIT);
} }

View File

@ -216,30 +216,6 @@ extern "C" {
*/ */
#define chThdShouldTerminate() (currp->p_flags & P_TERMINATE) #define chThdShouldTerminate() (currp->p_flags & P_TERMINATE)
/**
* Returns the exit event source for the specified thread. The source is
* signaled when the thread terminates.
* @param tp the pointer to the thread
* @note When registering on a thread termination make sure the thread
* is still alive, if you do that after the thread termination
* then you would miss the event. There are two ways to ensure
* this:<br>
* <ul>
* <li>Create the thread suspended, register on the event source
* and then resume the thread (recommended).</li>
* <li>Create the thread with a lower priority then register on it.
* This does not work if the hardware is capable of multiple
* physical threads.</li>
* </ul>
* @note You dont need to unregister from a terminated thread because
* the event source becomes inactive.
* @note The function is available only if the \p CH_USE_EXIT_EVENT
* option is enabled in \p chconf.h.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define chThdGetExitEventSource(tp) (&(tp)->p_exitesource)
/** /**
* Resumes a thread created with the \p P_SUSPENDED option or suspended with * Resumes a thread created with the \p P_SUSPENDED option or suspended with
* \p chThdSuspend(). * \p chThdSuspend().
@ -247,24 +223,6 @@ extern "C" {
*/ */
#define chThdResumeI(tp) chSchReadyI(tp) #define chThdResumeI(tp) chSchReadyI(tp)
/**
* Creates a new thread, simplified variant.
* @param prio the priority level for the new thread. Usually the threads are
* created with priority \p NORMALPRIO, priorities
* can range from \p LOWPRIO to \p HIGHPRIO.
* @param workspace pointer to a working area dedicated to the thread stack
* @param wsize size of the working area.
* @param pf the thread function
* @return the pointer to the \p Thread structure allocated for the
* thread into the working space area.
* @note A thread can terminate by calling \p chThdExit() or by simply
* returning from its main function.
* @deprecated Please use \p chThdCreateStatic() or \p chThdInit() instead,
* this function will be removed in version 1.0.0.
*/
#define chThdCreateFast(prio, workspace, wsize, pf) \
chThdCreateStatic(workspace, wsize, prio, pf, NULL)
/** /**
* Suspends the invoking thread for the specified time. * Suspends the invoking thread for the specified time.
* @param time the delay in system ticks * @param time the delay in system ticks

View File

@ -89,19 +89,11 @@
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT #define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve /** Configuration option: If enabled then the threads serve messages by
* messages by priority instead of FIFO order. * priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/ * @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_PRIORITY #define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included /** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/ * in the kernel.*/
#define CH_USE_QUEUES #define CH_USE_QUEUES

View File

@ -59,7 +59,7 @@ static char *bmk1_gettest(void) {
static void bmk1_execute(void) { static void bmk1_execute(void) {
uint32_t n; uint32_t n;
threads[0] = chThdCreateFast(chThdGetPriority()-1, wa[0], WA_SIZE, thread1); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread1, NULL);
n = msg_loop_test(threads[0]); n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]); chThdTerminate(threads[0]);
test_wait_threads(); test_wait_threads();
@ -85,7 +85,7 @@ static char *bmk2_gettest(void) {
static void bmk2_execute(void) { static void bmk2_execute(void) {
uint32_t n; uint32_t n;
threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread1); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread1, NULL);
n = msg_loop_test(threads[0]); n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]); chThdTerminate(threads[0]);
test_wait_threads(); test_wait_threads();
@ -116,11 +116,11 @@ static char *bmk3_gettest(void) {
static void bmk3_execute(void) { static void bmk3_execute(void) {
uint32_t n; uint32_t n;
threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread1); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread1, NULL);
threads[1] = chThdCreateFast(chThdGetPriority()-2, wa[1], WA_SIZE, thread2); threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-2, thread2, NULL);
threads[2] = chThdCreateFast(chThdGetPriority()-3, wa[2], WA_SIZE, thread2); threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread2, NULL);
threads[3] = chThdCreateFast(chThdGetPriority()-4, wa[3], WA_SIZE, thread2); threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-4, thread2, NULL);
threads[4] = chThdCreateFast(chThdGetPriority()-5, wa[4], WA_SIZE, thread2); threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-5, thread2, NULL);
n = msg_loop_test(threads[0]); n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]); chThdTerminate(threads[0]);
test_wait_threads(); test_wait_threads();
@ -151,7 +151,7 @@ static void bmk4_execute(void) {
test_wait_tick(); test_wait_tick();
test_start_timer(1000); test_start_timer(1000);
do { do {
chThdWait(chThdCreateFast(prio, wap, WA_SIZE, thread2)); chThdWait(chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL));
n++; n++;
#if defined(WIN32) #if defined(WIN32)
ChkIntSources(); ChkIntSources();
@ -182,7 +182,7 @@ static void bmk5_execute(void) {
test_wait_tick(); test_wait_tick();
test_start_timer(1000); test_start_timer(1000);
do { do {
chThdCreateFast(prio, wap, WA_SIZE, thread2); chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL);
n++; n++;
#if defined(WIN32) #if defined(WIN32)
ChkIntSources(); ChkIntSources();
@ -220,11 +220,11 @@ static void bmk6_setup(void) {
static void bmk6_execute(void) { static void bmk6_execute(void) {
uint32_t n; uint32_t n;
threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread3); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread3, NULL);
threads[1] = chThdCreateFast(chThdGetPriority()+2, wa[1], WA_SIZE, thread3); threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()+2, thread3, NULL);
threads[2] = chThdCreateFast(chThdGetPriority()+3, wa[2], WA_SIZE, thread3); threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()+3, thread3, NULL);
threads[3] = chThdCreateFast(chThdGetPriority()+4, wa[3], WA_SIZE, thread3); threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()+4, thread3, NULL);
threads[4] = chThdCreateFast(chThdGetPriority()+5, wa[4], WA_SIZE, thread3); threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()+5, thread3, NULL);
n = 0; n = 0;
test_wait_tick(); test_wait_tick();

View File

@ -53,11 +53,11 @@ static void cond1_execute(void) {
// Bacause priority inheritance. // Bacause priority inheritance.
tprio_t prio = chThdGetPriority(); tprio_t prio = chThdGetPriority();
threads[0] = chThdCreate(prio+1, 0, wa[0], WA_SIZE, thread1, "E"); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread1, "E");
threads[1] = chThdCreate(prio+2, 0, wa[1], WA_SIZE, thread1, "D"); threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread1, "D");
threads[2] = chThdCreate(prio+3, 0, wa[2], WA_SIZE, thread1, "C"); threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread1, "C");
threads[3] = chThdCreate(prio+4, 0, wa[3], WA_SIZE, thread1, "B"); threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread1, "B");
threads[4] = chThdCreate(prio+5, 0, wa[4], WA_SIZE, thread1, "A"); threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread1, "A");
test_assert(prio == chThdGetPriority(), "priority return failure"); test_assert(prio == chThdGetPriority(), "priority return failure");
chCondSignal(&c1); chCondSignal(&c1);
chCondSignal(&c1); chCondSignal(&c1);
@ -84,11 +84,11 @@ static void cond2_execute(void) {
// Bacause priority inheritance. // Bacause priority inheritance.
tprio_t prio = chThdGetPriority(); tprio_t prio = chThdGetPriority();
threads[0] = chThdCreate(prio+1, 0, wa[0], WA_SIZE, thread1, "E"); threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread1, "E");
threads[1] = chThdCreate(prio+2, 0, wa[1], WA_SIZE, thread1, "D"); threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread1, "D");
threads[2] = chThdCreate(prio+3, 0, wa[2], WA_SIZE, thread1, "C"); threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread1, "C");
threads[3] = chThdCreate(prio+4, 0, wa[3], WA_SIZE, thread1, "B"); threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread1, "B");
threads[4] = chThdCreate(prio+5, 0, wa[4], WA_SIZE, thread1, "A"); threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread1, "A");
test_assert(prio == chThdGetPriority(), "priority return failure"); test_assert(prio == chThdGetPriority(), "priority return failure");
chCondBroadcast(&c1); chCondBroadcast(&c1);
test_wait_threads(); test_wait_threads();