From 8a02a67d832e1c3515f91f97dcb2a2b61be3268f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 26 Jun 2008 14:35:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@326 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/testmtx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test') 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"); } -- cgit v1.2.3