Use nullptr
[ACE_TAO.git] / TAO / tests / AMI_Buffering / Client_Task.cpp
blobdb5bae4319d1608aeb93984d645d4e9955512547
2 #include "Client_Task.h"
4 Client_Task::Client_Task (CORBA::ORB_ptr orb)
5 : orb_ (CORBA::ORB::_duplicate (orb))
6 , terminate_loop_ (0)
10 void
11 Client_Task::terminate_loop ()
13 ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
14 this->terminate_loop_ = 1;
17 int
18 Client_Task::svc ()
20 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
21 try
23 while (1)
25 // run the even loop for 1 second...
26 ACE_Time_Value tv (1, 0);
27 this->orb_->run (tv);
29 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
30 if (this->terminate_loop_ != 0)
31 break;
34 catch (const CORBA::Exception&)
36 return -1;
38 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
39 return 0;