comparison packages/kernel/current/tests/thread2.cxx @ 132:0ae0bc38e387 ecos-sw-2000-10-31

Merge from eCos master repository on 2000-10-31-00:30:36-GMT
author jlarmour
date Tue, 31 Oct 2000 20:53:09 +0000
parents eb9fd8c04db3
children 4c750ce71ae3
comparison
equal deleted inserted replaced
131:8461114e4f19 132:0ae0bc38e387
38 // tests scheduler & threads & priorities 38 // tests scheduler & threads & priorities
39 // + create multiple threads with various priorities 39 // + create multiple threads with various priorities
40 // + check highest priority running thread is always running 40 // + check highest priority running thread is always running
41 // + check next highest runs when highest suspended 41 // + check next highest runs when highest suspended
42 // + check several threads of equal priority share time 42 // + check several threads of equal priority share time
43 // (only !CYG_SCHED_UNIQUE_PRIORITIES) 43 // (only !CYGINT_KERNEL_SCHEDULER_UNIQUE_PRIORITIES)
44 // + check other threads are starved 44 // + check other threads are starved
45 // + check setting priority dynamically causes a thread to 45 // + check setting priority dynamically causes a thread to
46 // become/stay current/non-current 46 // become/stay current/non-current
47 // Omissions: 47 // Omissions:
48 // check yield 48 // check yield
49 // check can set threads with min and max priority 49 // check can set threads with min and max priority
50 // Options: 50 // Options:
51 // CYG_SCHED_UNIQUE_PRIORITIES 51 // CYGINT_KERNEL_SCHEDULER_UNIQUE_PRIORITIES
52 // CYGIMP_THREAD_PRIORITY 52 // CYGIMP_THREAD_PRIORITY
53 // CYGNUM_KERNEL_SCHED_PRIORITIES 53 // CYGNUM_KERNEL_SCHED_PRIORITIES
54 // CYGSEM_KERNEL_SCHED_BITMAP 54 // CYGSEM_KERNEL_SCHED_BITMAP
55 // CYGSEM_KERNEL_SCHED_MLQUEUE 55 // CYGSEM_KERNEL_SCHED_MLQUEUE
56 //####DESCRIPTIONEND#### 56 //####DESCRIPTIONEND####
106 CHECK( 12 == q++ ); 106 CHECK( 12 == q++ );
107 CHECK( 9 == thread0->get_priority() ); 107 CHECK( 9 == thread0->get_priority() );
108 CHECK( 6 == thread1->get_priority() ); 108 CHECK( 6 == thread1->get_priority() );
109 CHECK( 7 == thread2->get_priority() ); 109 CHECK( 7 == thread2->get_priority() );
110 q = 100; 110 q = 100;
111 #if !(CYG_SCHED_UNIQUE_PRIORITIES) && defined(CYGSEM_KERNEL_SCHED_TIMESLICE) 111 #if !(CYGINT_KERNEL_SCHEDULER_UNIQUE_PRIORITIES) \
112 && defined(CYGSEM_KERNEL_SCHED_TIMESLICE)
112 thread2->set_priority(6); 113 thread2->set_priority(6);
113 CHECK( 6 == thread1->get_priority() ); 114 CHECK( 6 == thread1->get_priority() );
114 CHECK( 6 == thread2->get_priority() ); 115 CHECK( 6 == thread2->get_priority() );
115 116
116 while ( 100 == q ) 117 while ( 100 == q )
134 CHECK( 10 == q++ ); 135 CHECK( 10 == q++ );
135 thread2->set_priority(2); 136 thread2->set_priority(2);
136 CHECK( 11 == q++ ); 137 CHECK( 11 == q++ );
137 thread2->set_priority(7); 138 thread2->set_priority(7);
138 139
139 #if !(CYG_SCHED_UNIQUE_PRIORITIES) && defined(CYGSEM_KERNEL_SCHED_TIMESLICE) 140 #if !(CYGINT_KERNEL_SCHEDULER_UNIQUE_PRIORITIES) \
141 && defined(CYGSEM_KERNEL_SCHED_TIMESLICE)
140 CHECK( 6 == thread1->get_priority() ); 142 CHECK( 6 == thread1->get_priority() );
141 CHECK( 6 == thread2->get_priority() ); 143 CHECK( 6 == thread2->get_priority() );
142 144
143 CHECK( 100 == q++ ); 145 CHECK( 100 == q++ );
144 while ( 101 == q ) 146 while ( 101 == q )