3 #include "ace/High_Res_Timer.h"
4 #include "ace/OS_NS_unistd.h"
6 Test_i::Test_i (CORBA::ORB_ptr orb
)
7 : sleep_ (false), unsleep_ (true), shutdown_ (false)
8 , orb_ (CORBA::ORB::_duplicate (orb
))
16 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) ~Test_i>\n"));
20 Test_i::sleep (CORBA::Long sec
, CORBA::Long msec
)
22 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::sleep> enter\n"));
26 ACE_Time_Value
duration (sec
);
27 duration
.msec (static_cast<long> (msec
)); // HPUX seems to require this cast
29 if (sec
== 0 && msec
== 0) {
30 // 1000 seconds is infinity
34 ACE_Time_Value current
= ACE_High_Res_Timer::gettimeofday_hr ();
35 ACE_Time_Value timeout
= current
+ duration
;
37 ACE_Time_Value sleep_time
;
39 while (current
< timeout
) {
43 ACE_OS::sleep (sleep_time
);
44 current
+= sleep_time
;
48 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::sleep> exit\n"));
56 ACE_Time_Value sleep_time
;
58 while (unsleep_
== false) {
59 ACE_OS::sleep (sleep_time
);
61 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::unsleep>\n"));
65 Test_i::dummy_one_way (const char* msg
)
68 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::dummy_one_way> %.25C\n", msg
));
74 Test_i::dummy_two_way ()
76 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::dummy_two_way>\n"));
84 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Test_i::shutdown>\n"));