Merge pull request #2237 from DOCGroup/jwillemsen-patch-2-1
[ACE_TAO.git] / ACE / Kokyu / DSRT_CV_Dispatcher_Impl_T.h
blob1fcf16d5cee2f9bf4fecd493c76bfdeead7891ba
1 /* -*- C++ -*- */
2 /**
3 * @file DSRT_CV_Dispatcher_Impl_T.h
5 * @author Venkita Subramonian (venkita@cs.wustl.edu)
6 */
8 #ifndef DSRT_CV_DISPATCHER_IMPL_T_H
9 #define DSRT_CV_DISPATCHER_IMPL_T_H
10 #include /**/ "ace/pre.h"
11 #include "ace/Task.h"
12 #include "ace/Copy_Disabled.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "Kokyu_dsrt.h"
19 #include "DSRT_Sched_Queue_T.h"
20 #include "DSRT_Dispatcher_Impl_T.h"
22 namespace Kokyu
24 template<class DSRT_Scheduler_Traits>
25 class DSRT_CV_Dispatcher_Impl :
26 public DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits>,
27 public ACE_Copy_Disabled
29 public:
30 typedef typename
31 DSRT_Scheduler_Traits::Guid_t Guid_t;
33 typedef typename
34 DSRT_Scheduler_Traits::QoSDescriptor_t DSRT_QoSDescriptor;
36 DSRT_CV_Dispatcher_Impl (ACE_Sched_Params::Policy sched_policy,
37 int sched_scope);
39 int init_i (const DSRT_ConfigInfo&);
41 /// Schedule a thread dynamically based on the qos info supplied.
42 int schedule_i (Guid_t, const DSRT_QoSDescriptor&);
44 /// Update the schedule for a thread. This could alter the current
45 /// schedule.
46 int update_schedule_i (Guid_t, const DSRT_QoSDescriptor&);
48 /// Inform the scheduler that the caller thread is about to
49 /// block. This could alter the current schedule.
50 int update_schedule_i (Guid_t, Block_Flag_t);
52 /// Cancel the schedule for a thread. This could alter the current
53 /// schedule.
54 int cancel_schedule_i (Guid_t);
56 /// Shut down the dispatcher. The dispatcher will stop processing
57 /// requests.
58 int shutdown_i ();
60 private:
61 typedef ACE_SYNCH_MUTEX cond_lock_t;
62 typedef ACE_SYNCH_CONDITION cond_t;
64 cond_lock_t run_cond_lock_;
65 cond_t run_cond_;
69 #include "DSRT_CV_Dispatcher_Impl_T.cpp"
71 #include /**/ "ace/post.h"
72 #endif /* DSRT_DIRECT_DISPATCHER_IMPL_T_H */