File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,9 @@ void rr_test(void)
160160 bool test_passed = false;
161161 pthread_attr_t attr ;
162162 pthread_addr_t result ;
163+ #ifdef CONFIG_SMP
164+ cpu_set_t cpuset ;
165+ #endif
163166 int status ;
164167 int i ;
165168
@@ -199,6 +202,20 @@ void rr_test(void)
199202 printf ("rr_test: Set thread policy to SCHED_RR\n" );
200203 }
201204
205+ #ifdef CONFIG_SMP
206+ /* RR case on SMP only run on core0 */
207+
208+ CPU_ZERO (& cpuset );
209+ CPU_SET (0 , & cpuset );
210+ status = pthread_attr_setaffinity_np (& attr , sizeof (cpu_set_t ), & cpuset );
211+ if (status != OK )
212+ {
213+ printf ("rr_test: ERROR: pthread_attr_setaffinity_np failed,"
214+ " status=%d\n" , status );
215+ ASSERT (false);
216+ }
217+ #endif
218+
202219 /* This semaphore will prevent anything from running until we are ready */
203220
204221 sched_lock ();
You can’t perform that action at this time.
0 commit comments