diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-06-26 14:35:14 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-06-26 14:35:14 +0000 |
commit | 8a02a67d832e1c3515f91f97dcb2a2b61be3268f (patch) | |
tree | ded6ad8f41254669a7c5db93635317bd113e7f7a /test | |
parent | cc44376c6e07d5c47561db9f6179e51e0654391d (diff) | |
download | ChibiOS-8a02a67d832e1c3515f91f97dcb2a2b61be3268f.tar.gz ChibiOS-8a02a67d832e1c3515f91f97dcb2a2b61be3268f.tar.bz2 ChibiOS-8a02a67d832e1c3515f91f97dcb2a2b61be3268f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@326 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r-- | test/testmtx.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/testmtx.c b/test/testmtx.c index 2f1aaa33f..526a64ffa 100644 --- a/test/testmtx.c +++ b/test/testmtx.c @@ -48,13 +48,15 @@ static msg_t thread1(void *p) { static void mtx1_execute(void) {
+ tprio_t prio = chThdGetPriority(); // Bacause priority inheritance.
chMtxLock(&m1);
- threads[0] = chThdCreate(chThdGetPriority()+1, 0, wa[0], STKSIZE, thread1, "E");
- threads[1] = chThdCreate(chThdGetPriority()+2, 0, wa[1], STKSIZE, thread1, "D");
- threads[2] = chThdCreate(chThdGetPriority()+3, 0, wa[2], STKSIZE, thread1, "C");
- threads[3] = chThdCreate(chThdGetPriority()+4, 0, wa[3], STKSIZE, thread1, "B");
- threads[4] = chThdCreate(chThdGetPriority()+5, 0, wa[4], STKSIZE, thread1, "A");
+ threads[0] = chThdCreate(prio+1, 0, wa[0], STKSIZE, thread1, "E");
+ threads[1] = chThdCreate(prio+2, 0, wa[1], STKSIZE, thread1, "D");
+ threads[2] = chThdCreate(prio+3, 0, wa[2], STKSIZE, thread1, "C");
+ threads[3] = chThdCreate(prio+4, 0, wa[3], STKSIZE, thread1, "B");
+ threads[4] = chThdCreate(prio+5, 0, wa[4], STKSIZE, thread1, "A");
chMtxUnlock();
+ test_assert(prio == chThdGetPriority(), "priority return failure");
test_wait_threads();
test_assert_sequence("ABCDE");
}
|