Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / CSD_Strategy / ThreadPool2 / OrbShutdownTask.cpp
blob0aaadc3344bf5485389b3cb2f568c14b42fb4381
1 //=============================================================================
2 /**
3 * @file OrbShutdownTask.cpp
5 * @author Tim Bradley <bradley_t@ociweb.com>
6 */
7 //=============================================================================
9 #include "OrbShutdownTask.h"
10 #include "ace/CORBA_macros.h"
11 #include "ace/OS_NS_unistd.h"
13 OrbShutdownTask::OrbShutdownTask()
18 void
19 OrbShutdownTask::orb(CORBA::ORB_ptr orb)
21 this->orb_ = CORBA::ORB::_duplicate (orb);
24 int
25 OrbShutdownTask::open(void*)
27 if (this->activate(THR_NEW_LWP | THR_JOINABLE, 1) != 0)
29 //FUZZ: disable check_for_lack_ACE_OS
30 // Assumes that when activate returns non-zero return code that
31 // no threads were activated.
32 ACE_ERROR_RETURN((LM_ERROR,
33 "(%P|%t) OrbShutdownTask failed to open().\n"),
34 -1);
35 //FUZZ: enable check_for_lack_ACE_OS
38 return 0;
41 int
42 OrbShutdownTask::svc()
44 ACE_OS::sleep (2);
45 ACE_DEBUG ((LM_DEBUG, "(%P|%t)OrbShutdownTask::svc shutdown orb\n"));
46 try
48 this->orb_->shutdown(0);
50 catch (...)
52 ACE_ERROR((LM_ERROR,
53 "(%P|%t) Exception raised by ORB::shutdown() call "
54 "in OrbShutdownTask::svc().\n"));
57 return 0;
60 int
61 OrbShutdownTask::close(u_long)
63 return 0;