[rtems commit] rtems: Set postponed jobs in rate-monotonic cancel
Sebastian Huber
sebh at rtems.org
Wed Oct 6 06:50:07 UTC 2021
Module: rtems
Branch: master
Commit: 38c2147759d1b687a7330419a04a6c84d80b784a
Changeset: http://git.rtems.org/rtems/commit/?id=38c2147759d1b687a7330419a04a6c84d80b784a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Oct 6 08:46:21 2021 +0200
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.
---
cpukit/rtems/src/ratemoncancel.c | 1 +
cpukit/rtems/src/ratemonperiod.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/cpukit/rtems/src/ratemoncancel.c b/cpukit/rtems/src/ratemoncancel.c
index 3d95c06..ccc0394 100644
--- a/cpukit/rtems/src/ratemoncancel.c
+++ b/cpukit/rtems/src/ratemoncancel.c
@@ -35,6 +35,7 @@ void _Rate_monotonic_Cancel(
_Rate_monotonic_Acquire_critical( the_period, lock_context );
_Watchdog_Per_CPU_remove_ticks( &the_period->Timer );
+ the_period->postponed_jobs = 0;
the_period->state = RATE_MONOTONIC_INACTIVE;
_Scheduler_Cancel_job(
the_period->owner,
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 2c55eb0..7f0d302 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -217,7 +217,7 @@ static rtems_status_code _Rate_monotonic_Activate(
ISR_lock_Context *lock_context
)
{
- the_period->postponed_jobs = 0;
+ _Assert( the_period->postponed_jobs == 0 );
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Rate_monotonic_Restart( the_period, executing, lock_context );
More information about the vc
mailing list