Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / PICurrent / Terminator.cpp
blob91c028c1db8d0ee6699d066b3993c08b19785fb4
1 #include "Terminator.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/OS_NS_unistd.h"
5 int
6 Terminator::open(void*)
8 if(this->activate (THR_NEW_LWP | THR_JOINABLE,
9 1) == -1)
11 ACE_ERROR_RETURN((LM_ERROR,
12 ACE_TEXT("Terminator::open Error spawning thread %p\n"),
13 "err="),
14 -1);
16 return 0;
19 int
20 Terminator::svc()
22 while (1)
24 ACE_Message_Block* mb = 0;
25 if (this->getq(mb) == -1)
27 ACE_ERROR_RETURN ((LM_ERROR,
28 "(%P|%t|%T) ERROR: Terminator::svc() could not get "
29 "message block from queue"), -1);
32 if (mb->msg_type () == ACE_Message_Block::MB_HANGUP)
34 mb->release ();
35 break;
37 int delay_secs = ACE_OS::atoi(mb->rd_ptr());
38 ACE_DEBUG ((LM_DEBUG,
39 "(%P|%t|%T) Terminator::svc() Sleeping %d seconds before aborting\n", delay_secs));
40 ACE_OS::sleep(delay_secs);
41 ACE_OS::abort();
43 return 0;