summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcorino <mcorino@users.noreply.github.com>2011-12-14 18:20:31 +0000
committermcorino <mcorino@users.noreply.github.com>2011-12-14 18:20:31 +0000
commitb553caff218594c6cdaedcf1cec68be725a62f21 (patch)
treea0655274254064ffa3f2a6835c84a41ece48a076
parent01eb039cbc2232bb44b589635d11952e656902fa (diff)
downloadATCD-timer_policy.tar.gz
merged last timer_policy branch updatestimer_policy
-rw-r--r--ACE/ChangeLog.BRANCH13
-rw-r--r--ACE/ace/Abstract_Timer_Queue.h7
-rw-r--r--ACE/ace/Time_Policy.h24
-rw-r--r--ACE/ace/Time_Policy.inl28
-rw-r--r--ACE/ace/Time_Policy_T.h2
-rw-r--r--ACE/ace/Time_Policy_T.inl5
-rw-r--r--ACE/ace/Timer_Queue_T.cpp6
-rw-r--r--ACE/ace/Timer_Queue_T.h10
-rw-r--r--ACE/tests/Timer_Queue_Test.cpp2
-rw-r--r--CIAO/ChangeLog.BRANCH27
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp9
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp2
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp2
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp47
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp2
-rw-r--r--CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp46
-rw-r--r--TAO/ChangeLog.BRANCH15
-rw-r--r--TAO/tao/System_Time_Policy_Strategy.cpp55
-rw-r--r--TAO/tao/System_Time_Policy_Strategy.h66
-rw-r--r--TAO/tao/TAO_Internal.cpp2
-rw-r--r--TAO/tao/Time_Policy_Manager.cpp88
-rw-r--r--TAO/tao/tao.mpc2
-rw-r--r--TAO/tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp2
28 files changed, 637 insertions, 60 deletions
diff --git a/ACE/ChangeLog.BRANCH b/ACE/ChangeLog.BRANCH
index 2581e844275..adcd9f20ec5 100644
--- a/ACE/ChangeLog.BRANCH
+++ b/ACE/ChangeLog.BRANCH
@@ -1,3 +1,16 @@
+ Mon Dec 12 21:28:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * ace/Abstract_Timer_Queue.h:
+ * ace/Time_Policy.h:
+ * ace/Time_Policy.inl:
+ * ace/Time_Policy_T.h:
+ * ace/Time_Policy_T.inl:
+ * ace/Timer_Queue_T.cpp:
+ * ace/Timer_Queue_T.h:
+ * tests/Timer_Queue_Test.cpp:
+
+ Added backwards compatibility support.
+
Mon Dec 05 10:26:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
* ace/Time_Policy.inl
diff --git a/ACE/ace/Abstract_Timer_Queue.h b/ACE/ace/Abstract_Timer_Queue.h
index f01817ccc7f..5164ff02972 100644
--- a/ACE/ace/Abstract_Timer_Queue.h
+++ b/ACE/ace/Abstract_Timer_Queue.h
@@ -161,6 +161,13 @@ public:
*/
virtual ACE_Time_Value gettimeofday (void) = 0;
+ /**
+ * Allows applications to control how the timer queue gets the time
+ * of day.
+ * @deprecated Use TIME_POLICY support instead. See Timer_Queue_T.h
+ */
+ virtual void gettimeofday (ACE_Time_Value (*gettimeofday)(void)) = 0;
+
/// Determine the next event to timeout. Returns @a max if there are
/// no pending timers or if all pending timers are longer than max.
/// This method acquires a lock internally since it modifies internal state.
diff --git a/ACE/ace/Time_Policy.h b/ACE/ace/Time_Policy.h
index 0d8858f4009..b8f972a80e1 100644
--- a/ACE/ace/Time_Policy.h
+++ b/ACE/ace/Time_Policy.h
@@ -22,19 +22,22 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
- * @class ACE_Default_Time_Policy
+ * @class ACE_System_Time_Policy
*
- * @brief Implement the default time policy for ACE.
+ * @brief Implement the system time policy for ACE.
*
* The most common time policy is to simply use
* ACE_OS::gettimeofday(), this class implements that policy, i.e., it
* simply calls that function.
*/
-class ACE_Export ACE_Default_Time_Policy
+class ACE_Export ACE_System_Time_Policy
{
public:
/// Return the current time according to this policy
ACE_Time_Value operator() () const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
};
/**
@@ -48,6 +51,9 @@ class ACE_Export ACE_HR_Time_Policy
public:
/// Return the current time according to this policy
ACE_Time_Value operator() () const;
+
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
};
/**
@@ -88,7 +94,8 @@ public:
/// Return the current time according to this policy
ACE_Time_Value operator()() const;
-
+ /// Satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
private:
FPtr function_;
};
@@ -108,6 +115,8 @@ public:
/// Return the current time according to this policy
ACE_Time_Value operator()() const;
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
protected:
/// Return the current time according to policy implementation.
virtual ACE_Time_Value gettimeofday () const = 0;
@@ -134,6 +143,8 @@ public:
/// Copy policy
ACE_Delegating_Time_Policy& operator =(ACE_Delegating_Time_Policy const & pol);
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
private:
ACE_Dynamic_Time_Policy_Base const * delegate_;
@@ -146,6 +157,11 @@ private:
static NULL_Time_Policy null_policy_;
};
+/// Temporarily, for backwards compatibility reasons, this will
+/// be the default time policy. In time to be replaced by
+/// ACE_System_Time_Policy.
+typedef ACE_FPointer_Time_Policy ACE_Default_Time_Policy;
+
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
diff --git a/ACE/ace/Time_Policy.inl b/ACE/ace/Time_Policy.inl
index 10d28730a29..19fd9c6c206 100644
--- a/ACE/ace/Time_Policy.inl
+++ b/ACE/ace/Time_Policy.inl
@@ -8,17 +8,27 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE ACE_Time_Value
-ACE_Default_Time_Policy::operator()() const
+ACE_System_Time_Policy::operator()() const
{
return ACE_OS::gettimeofday();
}
+ACE_INLINE void
+ACE_System_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
ACE_INLINE ACE_Time_Value
ACE_HR_Time_Policy::operator()() const
{
return ACE_High_Res_Timer::gettimeofday_hr ();
}
+ACE_INLINE void
+ACE_HR_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
ACE_INLINE
ACE_FPointer_Time_Policy::ACE_FPointer_Time_Policy()
: function_(ACE_OS::gettimeofday)
@@ -38,12 +48,23 @@ ACE_FPointer_Time_Policy::operator()() const
return (*this->function_)();
}
+ACE_INLINE void
+ACE_FPointer_Time_Policy::set_gettimeofday (ACE_Time_Value (*f)(void))
+{
+ this->function_ = f;
+}
+
ACE_INLINE ACE_Time_Value
ACE_Dynamic_Time_Policy_Base::operator()() const
{
return this->gettimeofday ();
}
+ACE_INLINE void
+ACE_Dynamic_Time_Policy_Base::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
ACE_INLINE
ACE_Delegating_Time_Policy::ACE_Delegating_Time_Policy (ACE_Dynamic_Time_Policy_Base const * delegate)
: delegate_ (delegate != 0 ? delegate : &null_policy_)
@@ -57,6 +78,11 @@ ACE_Delegating_Time_Policy::operator()() const
}
ACE_INLINE void
+ACE_Delegating_Time_Policy::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+ACE_INLINE void
ACE_Delegating_Time_Policy::set_delegate (ACE_Dynamic_Time_Policy_Base const * delegate)
{
if (delegate != 0)
diff --git a/ACE/ace/Time_Policy_T.h b/ACE/ace/Time_Policy_T.h
index fce00b36a13..7fc084be377 100644
--- a/ACE/ace/Time_Policy_T.h
+++ b/ACE/ace/Time_Policy_T.h
@@ -46,6 +46,8 @@ public:
/// of day.
void set_time_policy(TIME_POLICY const & time_policy);
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*gettimeofday)(void));
protected:
/// Return the current time according to policy implementation.
virtual ACE_Time_Value gettimeofday () const;
diff --git a/ACE/ace/Time_Policy_T.inl b/ACE/ace/Time_Policy_T.inl
index a110ee7057b..4d30d6c6fc5 100644
--- a/ACE/ace/Time_Policy_T.inl
+++ b/ACE/ace/Time_Policy_T.inl
@@ -17,6 +17,11 @@ ACE_Time_Policy_T<TIME_POLICY>::operator() () const
}
template <typename TIME_POLICY> ACE_INLINE void
+ACE_Time_Policy_T<TIME_POLICY>::set_gettimeofday (ACE_Time_Value (*)(void))
+{
+}
+
+template <typename TIME_POLICY> ACE_INLINE void
ACE_Time_Policy_T<TIME_POLICY>::set_time_policy(TIME_POLICY const & time_policy)
{
this->time_policy_ = time_policy;
diff --git a/ACE/ace/Timer_Queue_T.cpp b/ACE/ace/Timer_Queue_T.cpp
index 86f96bbeb95..d0de6d0c68a 100644
--- a/ACE/ace/Timer_Queue_T.cpp
+++ b/ACE/ace/Timer_Queue_T.cpp
@@ -68,6 +68,12 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::gettimeofday()
return this->gettimeofday_static();
}
+template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> void
+ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
+{
+ this->time_policy_.set_gettimeofday (gettimeofday);
+}
+
template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> ACE_Time_Value *
ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>::calculate_timeout (ACE_Time_Value *max_wait_time)
{
diff --git a/ACE/ace/Timer_Queue_T.h b/ACE/ace/Timer_Queue_T.h
index c5d2a488329..609093e3450 100644
--- a/ACE/ace/Timer_Queue_T.h
+++ b/ACE/ace/Timer_Queue_T.h
@@ -126,6 +126,16 @@ public:
virtual ACE_Time_Value gettimeofday (void);
//@}
+ /**
+ * Allows applications to control how the timer queue gets the time
+ * of day.
+ * @deprecated Use TIME_POLICY support instead.
+ * This will only have effect when the TIME_POLICY used
+ * is ACE_FPointer_Time_Policy. Other standard ACE time
+ * policies will ignore this.
+ */
+ virtual void gettimeofday (ACE_Time_Value (*gettimeofday)(void));
+
/// Implement an inlined, non-abstract version of gettimeofday(),
/// through this member function the internals of the class can
/// make calls to ACE_OS::gettimeofday() with zero overhead.
diff --git a/ACE/tests/Timer_Queue_Test.cpp b/ACE/tests/Timer_Queue_Test.cpp
index be9514bc424..160613945e8 100644
--- a/ACE/tests/Timer_Queue_Test.cpp
+++ b/ACE/tests/Timer_Queue_Test.cpp
@@ -683,7 +683,7 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_Timer_Heap_Variable_Time_Source *tq_heap =
new ACE_Timer_Heap_Variable_Time_Source;
- tq_heap->set_time_policy(&ACE_High_Res_Timer::gettimeofday_hr);
+ tq_heap->gettimeofday(&ACE_High_Res_Timer::gettimeofday_hr);
ACE_NEW_RETURN (tq_stack,
Timer_Queue_Stack (tq_heap,
ACE_TEXT ("ACE_Timer_Heap (high-res timer)"),
diff --git a/CIAO/ChangeLog.BRANCH b/CIAO/ChangeLog.BRANCH
new file mode 100644
index 00000000000..63a89c881a2
--- /dev/null
+++ b/CIAO/ChangeLog.BRANCH
@@ -0,0 +1,27 @@
+ Wed Dec 14 08:56:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp:
+
+ Fixed compile error.
+
+ Tue Dec 13 10:28:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp:
+ * connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp:
+ * connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp:
+ * connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp:
+ * connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp:
+ * connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp:
+ * connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp:
+ * connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp:
+ * connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp:
+ * connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp:
+ * connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp:
+
+ Adapted tests to new time policy support.
+
+Local Variables:
+mode: change-log
+add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time))
+indent-tabs-mode: nil
+End:
diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp
index b6a0c8c1a71..b8549552c05 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp
+++ b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp
@@ -4,6 +4,7 @@
#include "ace/High_Res_Timer.h"
#include "tao/ORB_Core.h"
#include "ace/Timer_Queue.h"
+#include "ace/Timer_Heap.h"
#include "ace/Reactor.h"
#include "ace/Env_Value_T.h"
#include "Latency_Base.h"
@@ -466,6 +467,12 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
DummyPublisherListener * pub_listener = 0;
::DDS::Publisher * pub = 0;
+ typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
+ ACE_SYNCH_RECURSIVE_MUTEX,
+ ACE_HR_Time_Policy> timer_queue_type;
+ timer_queue_type hr_timer_q_;
+
try
{
ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id_);
@@ -479,7 +486,7 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
}
(void) ACE_High_Res_Timer::global_scale_factor ();
- ACE_Reactor::instance ()->timer_queue()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr);
+ ACE_Reactor::instance ()->timer_queue(&hr_timer_q_);
/* Create the domain participant */
DDSDomainParticipant * participant =
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp
index 80ba83c3245..1c354c09f03 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/Sender/Perf_Keyed_Test_Sender_exec.cpp
@@ -389,8 +389,6 @@ namespace CIAO_Perf_Keyed_Test_Sender_Impl
// if sleep and spin both > 0, use sleep value and ignore spin value
if (this->sleep_ > 0) // use reactor timer to sleep
{
- (void) ACE_High_Res_Timer::global_scale_factor ();
- this->reactor ()->timer_queue()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr);
if (this->reactor ()->schedule_timer(
this->ticker_,
0,
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp
index 8399d268940..5412707a5b0 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan.cdp
@@ -7,6 +7,23 @@
<label>Perf_Keyed_Test_Depl_1</label>
<UUID>Perf_Keyed_Test_Depl_1</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="ReceiverComponentImplementation">
<name>ReceiverComponentImplementation</name>
<source/>
@@ -226,6 +243,23 @@
</value>
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -436,6 +470,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Sender_ExecArtifact">
<name>Sender_exec</name>
<source/>
@@ -490,4 +530,11 @@
<node/>
<location>Receiver_stub</location>
</artifact>
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp
index 56f93729636..c87ff145c7c 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub.cdp
@@ -8,6 +8,23 @@
<UUID>Perf_Keyed_Test_Depl_1</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="Perf_Keyed_Test_ConnectorComponentImplementation">
<name>Perf_Keyed_Test_ConnectorComponentImplementation</name>
<source/>
@@ -139,6 +156,23 @@
</value>
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -306,6 +340,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Sender_ExecArtifact">
<name>Sender_exec</name>
<source/>
@@ -342,4 +382,11 @@
<node/>
<location>DDS_Perf_Keyed_Test_Connector_stub</location>
</artifact>
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp
index c5775900fd4..3dfb1a92dbe 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub3.cdp
@@ -8,6 +8,23 @@
<UUID>Perf_Keyed_Test_Depl_1</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="Perf_Keyed_Test_ConnectorComponentImplementation">
<name>Perf_Keyed_Test_ConnectorComponentImplementation</name>
<source/>
@@ -139,6 +156,23 @@
</value>
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -306,6 +340,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Sender_ExecArtifact">
<name>Sender_exec</name>
<source/>
@@ -342,4 +382,11 @@
<node/>
<location>DDS_Perf_Keyed_Test_Connector_stub</location>
</artifact>
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp
index 425adcda30a..8e6ae4cfb56 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/Plan_pub_BE.cdp
@@ -8,6 +8,23 @@
<UUID>Perf_Keyed_Test_Depl_1</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="Perf_Keyed_Test_ConnectorComponentImplementation">
<name>Perf_Keyed_Test_ConnectorComponentImplementation</name>
<source/>
@@ -139,6 +156,23 @@
</value>
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -306,6 +340,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Sender_ExecArtifact">
<name>Sender_exec</name>
<source/>
@@ -342,4 +382,11 @@
<node/>
<location>DDS_Perf_Keyed_Test_Connector_stub</location>
</artifact>
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp
index 20e8ff48be9..729f807942d 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Latency/Sender/LatencyTT_Test_Sender_exec.cpp
@@ -416,8 +416,6 @@ namespace CIAO_LatencyTT_Test_Sender_Impl
ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::start - "
"Start test with interval <%u.%u>\n",
sec, usec));
- (void) ACE_High_Res_Timer::global_scale_factor ();
- this->reactor ()->timer_queue ()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr);
if (this->reactor ()->schedule_timer(
this->ticker_,
0,
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp
index 14cb9e1f05d..f2fbc2eeb88 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_SharedMem.cdp
@@ -7,6 +7,23 @@
<label>LatencyTT_Test_Depl</label>
<UUID>LatencyTT_Test_Depl</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="ReceiverComponentImplementation">
<name>ReceiverComponentImplementation</name>
<source/>
@@ -282,6 +299,23 @@
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -523,6 +557,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Receiver_ExecArtifact">
<name>Receiver_exec</name>
<source/>
@@ -595,4 +635,11 @@
<node/>
<location>DDS_LatencyTT_TestSec_Connector_stub</location>
</artifact-->
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp
index 60b98b622aa..154f3b33733 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/Plan_UDPv4.cdp
@@ -7,6 +7,23 @@
<label>LatencyTT_Test_Depl</label>
<UUID>LatencyTT_Test_Depl</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
<implementation xmi:id="ReceiverComponentImplementation">
<name>ReceiverComponentImplementation</name>
<source/>
@@ -282,6 +299,23 @@
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -523,6 +557,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Receiver_ExecArtifact">
<name>Receiver_exec</name>
<source/>
@@ -595,4 +635,11 @@
<node/>
<location>DDS_LatencyTT_TestSec_Connector_stub</location>
</artifact-->
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp b/CIAO/connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp
index 4744b63373c..fd7f29acd57 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Throughput/Sender/Throughput_Sender_exec.cpp
@@ -279,8 +279,6 @@ namespace CIAO_Throughput_Sender_Impl
Sender_exec_i::start (void)
{
ACE_UINT64 const sec = this->duration_run_ + 5;
- (void) ACE_High_Res_Timer::global_scale_factor ();
- this->reactor ()->timer_queue()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr);
if (this->reactor ()->schedule_timer (
this->ticker_,
0,
diff --git a/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp b/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp
index 937563720a2..92f5f3a2062 100644
--- a/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp
+++ b/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/Plan_pub.cdp
@@ -7,6 +7,22 @@
<label>Throughput_Depl_2</label>
<UUID>Throughput_Depl_2</UUID>
+ <implementation xmi:id="CompSvrImpl">
+ <name>CompSvr</name>
+ <source />
+ <artifact xmi:idref="CompSvrArt" />
+ <execParameter>
+ <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
<implementation xmi:id="Throughput_ConnectorComponentImplementation">
<name>Throughput_ConnectorComponentImplementation</name>
@@ -224,6 +240,23 @@
</configProperty>
</instance>
+ <instance xmi:id="CompSvrInst">
+ <name>ComponentServerInstance</name>
+ <node>SenderNode</node>
+ <source />
+ <implementation xmi:idref="CompSvrImpl" />
+ <configProperty>
+ <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>-ORBSvcConfDirective "static Time_Policy_Manager '-ORBTimePolicyStrategy HR'"</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
<instance xmi:id="SenderComponentInstance">
<name>SenderComponent</name>
<node>SenderNode</node>
@@ -358,6 +391,12 @@
</internalEndpoint>
</connection>
+ <artifact xmi:id="CompSvrArt">
+ <name>CompoSvrArtifactName</name>
+ <source />
+ <node />
+ <location>dance_locality_manager</location>
+ </artifact>
<artifact xmi:id="Sender_ExecArtifact">
<name>Sender_exec</name>
<source/>
@@ -412,4 +451,11 @@
<node/>
<location>DDS_Throughput_Sec_Connector_stub</location>
</artifact>
+
+ <localityConstraint>
+ <constraint>SameProcess</constraint>
+ <constrainedInstance xmi:idref="CompSvrInst" />
+ <constrainedInstance xmi:idref="SenderComponentInstance" />
+ </localityConstraint>
+
</Deployment:DeploymentPlan>
diff --git a/TAO/ChangeLog.BRANCH b/TAO/ChangeLog.BRANCH
index 0558c828de9..2000eeea07f 100644
--- a/TAO/ChangeLog.BRANCH
+++ b/TAO/ChangeLog.BRANCH
@@ -1,3 +1,18 @@
+ Mon Dec 12 21:28:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
+
+ * tao/System_Time_Policy_Strategy.cpp:
+ * tao/System_Time_Policy_Strategy.h:
+ * tao/TAO_Internal.cpp:
+ * tao/Time_Policy_Manager.cpp:
+ * tao/tao.mpc:
+
+ Added new time policy strategy to replace backwards
+ compatible default time policy in ACE.
+
+ * tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp:
+
+ Added backwards compatibility support.
+
Thu Dec 08 15:34:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
* tao/HR_Time_Policy_Strategy.h
diff --git a/TAO/tao/System_Time_Policy_Strategy.cpp b/TAO/tao/System_Time_Policy_Strategy.cpp
new file mode 100644
index 00000000000..c5834b6841f
--- /dev/null
+++ b/TAO/tao/System_Time_Policy_Strategy.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "tao/System_Time_Policy_Strategy.h"
+
+#include "ace/Timer_Heap_T.h"
+#include "ace/Event_Handler_Handle_Timeout_Upcall.h"
+
+#if (TAO_HAS_TIME_POLICY == 1)
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Time_Policy_T<ACE_System_Time_Policy> TAO_System_Time_Policy_Strategy::time_policy_;
+
+TAO_System_Time_Policy_Strategy::~TAO_System_Time_Policy_Strategy ()
+{
+}
+
+ACE_Timer_Queue * TAO_System_Time_Policy_Strategy::create_timer_queue (void)
+{
+ ACE_Timer_Queue * tmq = 0;
+
+ typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
+ ACE_Event_Handler_Handle_Timeout_Upcall,
+ ACE_SYNCH_RECURSIVE_MUTEX,
+ ACE_System_Time_Policy> timer_queue_type;
+ ACE_NEW_RETURN (tmq, timer_queue_type (), 0);
+
+ return tmq;
+}
+
+void
+TAO_System_Time_Policy_Strategy::destroy_timer_queue (ACE_Timer_Queue *tmq)
+{
+ delete tmq;
+}
+
+ACE_Dynamic_Time_Policy_Base * TAO_System_Time_Policy_Strategy::get_time_policy (void)
+{
+ return &time_policy_;
+}
+
+
+ACE_STATIC_SVC_DEFINE (TAO_System_Time_Policy_Strategy,
+ ACE_TEXT ("TAO_SYSTEM_TIME_POLICY"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_System_Time_Policy_Strategy),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO, TAO_System_Time_Policy_Strategy)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_TIME_POLICY */
diff --git a/TAO/tao/System_Time_Policy_Strategy.h b/TAO/tao/System_Time_Policy_Strategy.h
new file mode 100644
index 00000000000..d654b84b10e
--- /dev/null
+++ b/TAO/tao/System_Time_Policy_Strategy.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file System_Time_Policy_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Martin Corino <mcorino@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef SYSTEM_TIME_POLICY_STRATEGY_H
+#define SYSTEM_TIME_POLICY_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "tao/TAO_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+
+#if (TAO_HAS_TIME_POLICY == 1)
+
+#include "tao/Time_Policy_Strategy.h"
+
+#include "ace/Time_Policy_T.h"
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_System_Time_Policy_Strategy
+ *
+ * @brief Time policy strategy providing Highres time.
+ *
+ */
+class TAO_Export TAO_System_Time_Policy_Strategy
+ : public TAO_Time_Policy_Strategy
+{
+public:
+ virtual ~TAO_System_Time_Policy_Strategy ();
+
+ virtual ACE_Timer_Queue * create_timer_queue (void);
+
+ virtual void destroy_timer_queue (ACE_Timer_Queue *tmq);
+
+ virtual ACE_Dynamic_Time_Policy_Base * get_time_policy (void);
+
+private:
+ static ACE_Time_Policy_T<ACE_System_Time_Policy> time_policy_;
+};
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_System_Time_Policy_Strategy)
+ACE_FACTORY_DECLARE (TAO, TAO_System_Time_Policy_Strategy)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_TIME_POLICY */
+
+#include /**/ "ace/post.h"
+
+#endif /* SYSTEM_TIME_POLICY_STRATEGY_H */
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp
index 1f87dd689ca..98fc684daff 100644
--- a/TAO/tao/TAO_Internal.cpp
+++ b/TAO/tao/TAO_Internal.cpp
@@ -22,6 +22,7 @@
#include "tao/Codeset_Manager_Factory_Base.h"
#include "tao/Codeset_Manager.h"
#include "tao/Time_Policy_Manager.h"
+#include "tao/System_Time_Policy_Strategy.h"
#include "tao/HR_Time_Policy_Strategy.h"
#include "tao/debug.h"
@@ -684,6 +685,7 @@ namespace
pcfg->process_directive (ace_svc_desc_TAO_Default_Collocation_Resolver);
#if (TAO_HAS_TIME_POLICY == 1)
pcfg->process_directive (ace_svc_desc_TAO_Time_Policy_Manager);
+ pcfg->process_directive (ace_svc_desc_TAO_System_Time_Policy_Strategy);
pcfg->process_directive (ace_svc_desc_TAO_HR_Time_Policy_Strategy);
#endif
diff --git a/TAO/tao/Time_Policy_Manager.cpp b/TAO/tao/Time_Policy_Manager.cpp
index 8bd8945a444..be496fc739a 100644
--- a/TAO/tao/Time_Policy_Manager.cpp
+++ b/TAO/tao/Time_Policy_Manager.cpp
@@ -72,58 +72,52 @@ TAO_Time_Policy_Manager::parse_args (int argc, ACE_TCHAR* argv[])
ACE_Timer_Queue * TAO_Time_Policy_Manager::create_timer_queue (void)
{
- if (this->time_policy_setting_ != TAO_OS_TIME_POLICY)
- {
- // locking scope
+ // locking scope
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ 0);
+
+ // check if time policy strategy has already been initialized
+ if (this->time_policy_strategy_ == 0)
{
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
- monitor,
- this->lock_,
- 0);
-
- // check if time policy strategy has already been initialized
+ // load strategy
+ if (this->time_policy_setting_ == TAO_OS_TIME_POLICY)
+ {
+ this->time_policy_name_ = ACE_TEXT ("TAO_SYSTEM_TIME_POLICY");
+ }
+ else if (this->time_policy_setting_ == TAO_HR_TIME_POLICY)
+ {
+ this->time_policy_name_ = ACE_TEXT ("TAO_HR_TIME_POLICY");
+ }
+ this->time_policy_strategy_ =
+ ACE_Dynamic_Service<TAO_Time_Policy_Strategy>::instance (
+ this->time_policy_name_.c_str ());
if (this->time_policy_strategy_ == 0)
{
- // load strategy
- if (this->time_policy_setting_ == TAO_HR_TIME_POLICY)
- {
- this->time_policy_name_ = ACE_TEXT ("TAO_HR_TIME_POLICY");
- this->time_policy_strategy_ =
- ACE_Dynamic_Service<TAO_Time_Policy_Strategy>::instance (
- this->time_policy_name_.c_str ());
- }
- else
- this->time_policy_strategy_ =
- ACE_Dynamic_Service<TAO_Time_Policy_Strategy>::instance (
- this->time_policy_name_.c_str ());
- if (this->time_policy_strategy_ == 0)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("TAO (%P|%t) - TAO_Time_Policy_Manager: ")
- ACE_TEXT ("FAILED to load time policy strategy '%C'\n"),
- this->time_policy_name_.c_str ()));
- return 0;
- }
-
- if (TAO_debug_level > 1)
- {
- ACE_DEBUG ((LM_INFO,
- ACE_TEXT ("TAO (%P|%t) - TAO_Time_Policy_Manager: ")
- ACE_TEXT ("loaded time policy strategy '%C'\n"),
- this->time_policy_name_.c_str ()));
- }
-
- // handle one time initialization of ORB_Time_Policy
- TAO::ORB_Time_Policy::set_time_policy (
- this->time_policy_strategy_->get_time_policy ());
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - TAO_Time_Policy_Manager: ")
+ ACE_TEXT ("FAILED to load time policy strategy '%C'\n"),
+ this->time_policy_name_.c_str ()));
+ return 0;
}
- }
- return this->time_policy_strategy_->create_timer_queue ();
- }
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO (%P|%t) - TAO_Time_Policy_Manager: ")
+ ACE_TEXT ("loaded time policy strategy '%C'\n"),
+ this->time_policy_name_.c_str ()));
+ }
- // OS time policy is builtin default
- return 0;
+ // handle one time initialization of ORB_Time_Policy
+ TAO::ORB_Time_Policy::set_time_policy (
+ this->time_policy_strategy_->get_time_policy ());
+ }
+ }
+
+ return this->time_policy_strategy_->create_timer_queue ();
}
void
@@ -137,7 +131,7 @@ TAO_Time_Policy_Manager::destroy_timer_queue (ACE_Timer_Queue *tmq)
monitor,
this->lock_);
- // check if time policy strategy has already been initialized
+ // check if time policy strategy has been initialized
if (this->time_policy_strategy_ == 0)
{
return;
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index 8c90d52c842..04204c76b6e 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -279,6 +279,7 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid
Synch_Invocation.cpp
Synch_Queued_Message.cpp
Synch_Reply_Dispatcher.cpp
+ System_Time_Policy_Strategy.cpp
SystemException.cpp
Tagged_Components.cpp
Tagged_Profile.cpp
@@ -592,6 +593,7 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid
Synch_Invocation.h
Synch_Queued_Message.h
Synch_Reply_Dispatcher.h
+ System_Time_Policy_Strategy.h
SystemException.h
Tagged_Components.h
Tagged_Profile.h
diff --git a/TAO/tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp b/TAO/tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp
index 737b881c498..4ebece41b8b 100644
--- a/TAO/tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp
+++ b/TAO/tests/Time_Policy_Custom/Custom_Time_Policy_Strategy.cpp
@@ -17,6 +17,8 @@ public:
ACE_Time_Value tv = ACE_High_Res_Timer::gettimeofday_hr ();
return (tv += ACE_Time_Value (10, 0));
}
+ /// Noop. Just here to satisfy backwards compatibility demands.
+ void set_gettimeofday (ACE_Time_Value (*)(void)) {}
};
static ACE_Time_Policy_T<Custom_Time_Policy> custom_time_policy_;