summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/ratemontimeout.c
diff options
context:
space:
mode:
authorKuan-Hsun Chen <c0066c@gmail.com>2016-12-21 17:42:39 +0100
committerGedare Bloom <gedare@rtems.org>2017-01-13 13:55:13 -0500
commit3a46b72455721c223ad1501c209a9e414d409f7a (patch)
tree3c5eb108d65ec14ffcc93063627bad2ec4b97fdc /cpukit/rtems/src/ratemontimeout.c
parentposix: shared memory support (diff)
downloadrtems-3a46b72455721c223ad1501c209a9e414d409f7a.tar.bz2
Enhancement of the RMS manager for the overrun handling.
Three additional functions: rtems_rate_monotonic_postponed_job_count, _Rate_monotonic_Renew_deadline, and _Rate_monotonic_Release_postponed_job. Four refined functions: _Rate_monotonic_Activate, _Rate_monotonic_Block_while_expired, rtems_rate_monotonic_period, _Rate_monotonic_Timeout. Rate_monotonic_Control contains one counter for counting the postponed jobs and one for recording the recent deadline. Update #2795.
Diffstat (limited to 'cpukit/rtems/src/ratemontimeout.c')
-rw-r--r--cpukit/rtems/src/ratemontimeout.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c
index e514a314b3..c2a0291fd8 100644
--- a/cpukit/rtems/src/ratemontimeout.c
+++ b/cpukit/rtems/src/ratemontimeout.c
@@ -9,6 +9,8 @@
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
+ * COPYRIGHT (c) 2016 Kuan-Hsun Chen.
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
@@ -62,7 +64,14 @@ void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
_Thread_Unblock( owner );
}
} else {
+ /*
+ * If the watchdog is timeout, it means there is an additional postponed
+ * job in the next period but it is not available to release now:
+ * Either the current task is still executed, or it is preemptive by the
+ * other higher priority tasks.
+ */
+ the_period->postponed_jobs += 1;
the_period->state = RATE_MONOTONIC_EXPIRED;
- _Rate_monotonic_Release( the_period, &lock_context );
+ _Rate_monotonic_Renew_deadline( the_period, owner, &lock_context );
}
}