forked from Imagelibrary/rtems
rtems: Fix rtems_task_create() scheduler selection
Use the home scheduler of the executing thread for the created thread. This is in line with pthread_create(). Using the current processor may pick up an unexpected scheduler in case of a temporary migration, e.g. due to locking protocols.
This commit is contained in:
@@ -90,7 +90,7 @@ rtems_status_code rtems_task_create(
|
||||
}
|
||||
}
|
||||
|
||||
scheduler = _Scheduler_Get_by_CPU_index( _SMP_Get_current_processor() );
|
||||
scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
|
||||
|
||||
priority = _RTEMS_Priority_To_core( scheduler, initial_priority, &valid );
|
||||
if ( !valid ) {
|
||||
|
||||
Reference in New Issue
Block a user