summaryrefslogtreecommitdiff
path: root/Kokyu
diff options
context:
space:
mode:
authoryfzhang <yfzhang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-06-13 05:49:35 +0000
committeryfzhang <yfzhang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-06-13 05:49:35 +0000
commit3c943a7abc74a12690315d0022ad592445d64730 (patch)
treebd2dc2634b13f2e8db809ee93ad8f9c498c6d8ff /Kokyu
parentd7534667e283ab10425813cd9a7cfadae047a593 (diff)
downloadATCD-3c943a7abc74a12690315d0022ad592445d64730.tar.gz
add change_prio method which is called by DSRT_Direct_Dispatcher_Impl_T.cpp
Diffstat (limited to 'Kokyu')
-rw-r--r--Kokyu/DSRT_Sched_Queue_T.cpp30
-rw-r--r--Kokyu/DSRT_Sched_Queue_T.h5
2 files changed, 35 insertions, 0 deletions
diff --git a/Kokyu/DSRT_Sched_Queue_T.cpp b/Kokyu/DSRT_Sched_Queue_T.cpp
index 8d6e95dc8d9..30845823aa1 100644
--- a/Kokyu/DSRT_Sched_Queue_T.cpp
+++ b/Kokyu/DSRT_Sched_Queue_T.cpp
@@ -250,6 +250,36 @@ dump ()
ACE_DEBUG ((LM_DEBUG, "(%t|%T):##########################\n"));
}
+template <class DSRT_Scheduler_Traits,
+ class More_Eligible_Comparator,
+ class ACE_LOCK>
+int Sched_Ready_Queue<DSRT_Scheduler_Traits,
+ More_Eligible_Comparator,
+ ACE_LOCK>::
+change_prio(int old_prio, int new_prio, int policy)
+{
+ if (dispatch_items_prio_queue_.current_size ())
+ {
+ PRIO_QUEUE_ITERATOR end_iter = dispatch_items_prio_queue_.end ();
+ PRIO_QUEUE_ITERATOR iter;
+ int prio;
+
+ iter = dispatch_items_prio_queue_.begin ();
+ while( iter != end_iter )
+ {
+ PRIO_QUEUE_ENTRY &ent = (*iter);
+ DSRT_Dispatch_Item_var<DSRT_Scheduler_Traits>
+ item_var = ent.item ();
+ ACE_OS::thr_getprio (item_var->thread_handle (), prio);
+ if (prio==old_prio) {
+ ACE_OS::thr_setprio(item_var->thread_handle (), new_prio, policy);
+ }
+ ++iter;
+ }
+ }
+ return(0);
+}
+
}
#endif /* DSRT_SCHED_QUEUE_T_CPP */
diff --git a/Kokyu/DSRT_Sched_Queue_T.h b/Kokyu/DSRT_Sched_Queue_T.h
index 166009d7fb3..e4544f2b92b 100644
--- a/Kokyu/DSRT_Sched_Queue_T.h
+++ b/Kokyu/DSRT_Sched_Queue_T.h
@@ -124,6 +124,11 @@ namespace Kokyu
int most_eligible (DSRT_Dispatch_Item_var<DSRT_Scheduler_Traits>&
item);
+ /**
+ * change blocked_prio_ item to inactive_prio_
+ */
+ int change_prio (int old_prio, int new_prio, int policy);
+
void dump();
private: