Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Bug_1020_Basic_Regression / Echo.cpp
blob527465413b41d3a9827cf5132e45f59568e8c9ed
1 #include "Echo.h"
2 #include "ace/OS_NS_unistd.h"
4 Echo::Echo(CORBA::ORB_ptr orb,
5 int abort_counter)
6 : orb_(CORBA::ORB::_duplicate(orb))
7 , abort_counter_ (abort_counter),
8 mutex_ ()
12 void
13 Echo::echo_payload (Test::Payload &)
15 ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX,
16 ace_mon,
17 this->mutex_));
19 this->abort_counter_--;
21 if (this->abort_counter_ == 0)
23 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload, sleeping\n"));
25 // Sleep for 10 seconds, forcing a flow control of some kind.
26 ACE_OS::sleep (5);
28 // Run the ORB for a while, to generate a short-lived release of
29 // the flow control.
30 /*ACE_Time_Value tv (0, 10000);
31 this->orb_->run (tv);*/
33 ACE_DEBUG ((LM_DEBUG,
34 "(%P|%t) Echo::echo_payload, aborting\n"));
36 // Kill the app
37 ACE_OS::abort();