score: Fix _Scheduler_EDF_Cancel_job()

Remove the priority node only in case it is active.
This commit is contained in:
Sebastian Huber
2019-03-01 10:12:42 +01:00
parent a3db5001e5
commit 03b21633d9
3 changed files with 23 additions and 2 deletions
+4 -2
View File
@@ -84,8 +84,10 @@ void _Scheduler_EDF_Cancel_job(
_Thread_Wait_acquire_critical( the_thread, queue_context );
_Thread_Priority_remove( the_thread, priority_node, queue_context );
_Priority_Node_set_inactive( priority_node );
if ( _Priority_Node_is_active( priority_node ) ) {
_Thread_Priority_remove( the_thread, priority_node, queue_context );
_Priority_Node_set_inactive( priority_node );
}
_Thread_Wait_release_critical( the_thread, queue_context );
}
+17
View File
@@ -30,6 +30,21 @@ const char rtems_test_name[] = "SPEDFSCHED 2";
rtems_task_priority Prio[7] = { 0, 2, 2, 2, 2, 100, 1 };
static void test_period_create_delete( void )
{
rtems_status_code sc;
rtems_id id;
sc = rtems_rate_monotonic_create(
rtems_build_name( 'R', 'T', 'M', 'N' ),
&id
);
rtems_test_assert( sc == RTEMS_SUCCESSFUL );
sc = rtems_rate_monotonic_delete( id );
rtems_test_assert( sc == RTEMS_SUCCESSFUL );
}
rtems_task Init(
rtems_task_argument argument
)
@@ -41,6 +56,8 @@ rtems_task Init(
TEST_BEGIN();
test_period_create_delete();
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
@@ -17,3 +17,5 @@ directives:
concepts:
a. Verifies EDF Scheduling behavior.
b. Verifies that a period object can be deleted immediatley after creation.