Mercurial > ecos
diff packages/kernel/current/tests/flag1.cxx @ 157:b65ec671dd4c
Merge from eCos master repository on 2001-04-06-18:28:36-BST
| author | jlarmour |
|---|---|
| date | Fri, 06 Apr 2001 19:06:06 +0000 |
| parents | eb9fd8c04db3 |
| children | e0c0827131d1 |
line wrap: on
line diff
--- a/packages/kernel/current/tests/flag1.cxx +++ b/packages/kernel/current/tests/flag1.cxx @@ -59,6 +59,9 @@ static Cyg_Flag f2; #endif static volatile cyg_atomic q = 0; +#define FIRST_THREAD_WAIT_TIME 5 +#define SECOND_THREAD_WAIT_TIME 10 +#define THIRD_THREAD_WAIT_TIME 20 static void entry0( CYG_ADDRWORD data ) { @@ -94,7 +97,7 @@ static void entry0( CYG_ADDRWORD data ) f2.wait(0x2, Cyg_Flag::OR); CYG_TEST_CHECK(20==q,"bad synchronization"); f2.wait(0x10, Cyg_Flag::AND, - Cyg_Clock::real_time_clock->current_value()+80); + Cyg_Clock::real_time_clock->current_value()+THIRD_THREAD_WAIT_TIME); CYG_TEST_CHECK(21==q++,"bad synchronization"); #endif f0.wait(1, Cyg_Flag::OR); @@ -138,7 +141,7 @@ static void entry1( CYG_ADDRWORD data ) CYG_TEST_CHECK(!f0.waiting(), "waiting()"); #ifdef CYGFUN_KERNEL_THREADS_TIMER - thread[1]->delay(40); // allow other threads to reach wait on f1 + thread[1]->delay( 10 ); // allow other threads to reach wait on f1 CYG_TEST_CHECK(f1.waiting(), "waiting() not true"); f1.setbits(); // wake one of t0,t2 CYG_TEST_CHECK(f1.waiting(), "waiting() not true"); @@ -154,7 +157,7 @@ static void entry1( CYG_ADDRWORD data ) f2.setbits(0x2); // synchronize with t0,t2 CYG_TEST_CHECK(20==q,"bad synchronization"); f2.wait(0x20, Cyg_Flag::AND, - Cyg_Clock::real_time_clock->current_value()+40); + Cyg_Clock::real_time_clock->current_value()+SECOND_THREAD_WAIT_TIME); CYG_TEST_CHECK(22==q++,"bad synchronization"); #endif @@ -171,7 +174,7 @@ static void entry2( CYG_ADDRWORD data ) f2.wait(0x2, Cyg_Flag::OR); CYG_TEST_CHECK(20==q,"bad synchronization"); CYG_TEST_CHECK(0==f2.wait(0x40, Cyg_Flag::AND, - Cyg_Clock::real_time_clock->current_value()+20), + Cyg_Clock::real_time_clock->current_value()+FIRST_THREAD_WAIT_TIME), "timed wait() wrong"); CYG_TEST_CHECK(20==q++,"bad synchronization"); // Now wake t0 before it times out
