summaryrefslogtreecommitdiff
path: root/cesar/ecos/packages/kernel/current/src/sched/sched.cxx
diff options
context:
space:
mode:
authorNicolas Schodet2011-12-16 17:13:50 +0100
committerNicolas Schodet2011-12-20 14:46:34 +0100
commit7aade45c20b0fa20bc15e349fa9e381dbb634fc3 (patch)
treead29d79c3cb243248de1f392578ca2f49825d508 /cesar/ecos/packages/kernel/current/src/sched/sched.cxx
parent97a6a95a7f59f04f1b7729454b2f91c4dd291ac2 (diff)
cesar/ecos/packages/kernel: reserve cpu for threads execution, closes #2834
Every time DSRs used its time quantum, threads are given a small amount of time if requested. Limitations: - If there is not much DSR pressure, once DSRs consumed their quantum after a while, threads are given time even if they were not starved. This should not be a problem as there is not much DSR pressure. - Once time is given to threads, DSRs will not be executed until an interrupt occurs or the DSR is unlocked. This should not be a problem as the tick timer interrupt triggers regularly.
Diffstat (limited to 'cesar/ecos/packages/kernel/current/src/sched/sched.cxx')
-rw-r--r--cesar/ecos/packages/kernel/current/src/sched/sched.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/cesar/ecos/packages/kernel/current/src/sched/sched.cxx b/cesar/ecos/packages/kernel/current/src/sched/sched.cxx
index cf8249f941..63f894a818 100644
--- a/cesar/ecos/packages/kernel/current/src/sched/sched.cxx
+++ b/cesar/ecos/packages/kernel/current/src/sched/sched.cxx
@@ -266,7 +266,8 @@ void Cyg_Scheduler::unlock_inner( cyg_ucount32 new_lock )
// a DSR could have been posted during a reschedule, but would
// not be run until the _next_ time we release the sched lock.
- if( Cyg_Interrupt::DSRs_pending() ) {
+ if( Cyg_Interrupt::DSRs_pending()
+ && !Cyg_Interrupt::DSRs_disabled()) {
inc_sched_lock(); // reclaim the lock
continue; // go back to head of loop
}