rtems: Set postponed jobs in rate-monotonic cancel

Set the postponed jobs count to zero in rtems_rate_monotonic_cancel() so that
rtems_rate_monotonic_get_status() returns a consistent status for inactive
periods.

Update #4511.
This commit is contained in:
Sebastian Huber
2021-10-06 08:46:21 +02:00
parent 226d0e9218
commit 38c2147759
2 changed files with 2 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ void _Rate_monotonic_Cancel(
_Rate_monotonic_Acquire_critical( the_period, lock_context ); _Rate_monotonic_Acquire_critical( the_period, lock_context );
_Watchdog_Per_CPU_remove_ticks( &the_period->Timer ); _Watchdog_Per_CPU_remove_ticks( &the_period->Timer );
the_period->postponed_jobs = 0;
the_period->state = RATE_MONOTONIC_INACTIVE; the_period->state = RATE_MONOTONIC_INACTIVE;
_Scheduler_Cancel_job( _Scheduler_Cancel_job(
the_period->owner, the_period->owner,

View File

@@ -217,7 +217,7 @@ static rtems_status_code _Rate_monotonic_Activate(
ISR_lock_Context *lock_context ISR_lock_Context *lock_context
) )
{ {
the_period->postponed_jobs = 0; _Assert( the_period->postponed_jobs == 0 );
the_period->state = RATE_MONOTONIC_ACTIVE; the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length; the_period->next_length = length;
_Rate_monotonic_Restart( the_period, executing, lock_context ); _Rate_monotonic_Restart( the_period, executing, lock_context );