diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 06:36:13 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-09 15:27:29 +0100 |
commit | 2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5 (patch) | |
tree | f27e6300271c5a5d47f6ef41a6d5c4780b715fc7 /cpukit/rtems/src/tasksetscheduler.c | |
parent | score: Fix _MRSP_Initialize() (diff) | |
download | rtems-2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5.tar.bz2 |
score: Simplify _Scheduler_Get_by_id()
Avoid dead code in non-SMP configurations. Return scheduler identifier
independent of the current processor count of the scheduler via
rtems_scheduler_ident(), since this value may change during run-time.
Check the processor count in _Scheduler_Set() under scheduler lock
protection.
Update #2797.
Diffstat (limited to 'cpukit/rtems/src/tasksetscheduler.c')
-rw-r--r-- | cpukit/rtems/src/tasksetscheduler.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/rtems/src/tasksetscheduler.c b/cpukit/rtems/src/tasksetscheduler.c index 3a860a197b..f3b7143d7b 100644 --- a/cpukit/rtems/src/tasksetscheduler.c +++ b/cpukit/rtems/src/tasksetscheduler.c @@ -35,7 +35,8 @@ rtems_status_code rtems_task_set_scheduler( Priority_Control core_priority; Status_Control status; - if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) { + scheduler = _Scheduler_Get_by_id( scheduler_id ); + if ( scheduler == NULL ) { return RTEMS_INVALID_ID; } |