3 #include "ace/Log_Msg.h"
5 class ExitHandler
: public ACE_At_Thread_Exit
10 ACE_DEBUG ((LM_INFO
, ACE_TEXT ("(%t) is exiting\n")));
12 // Shut down all devices.
16 // Listing 2 code/ch13
17 class HA_CommandHandler
: public ACE_Task_Base
20 HA_CommandHandler(ExitHandler
& eh
) : eh_(eh
)
25 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("(%t) starting up\n")));
27 this->thr_mgr ()->at_exit (eh_
);
42 // Listing 3 code/ch13
43 int ACE_TMAIN (int, ACE_TCHAR
*[])
47 HA_CommandHandler
handler (eh
);
50 ACE_Thread_Manager::instance ()->wait ();
55 // Listing 4 code/ch13
56 int ACE_TMAIN (int, ACE_TCHAR
*[])
59 ACE_Thread_Manager tm
;
61 HA_CommandHandler
handler (eh
);
62 handler
.thr_mgr (&tm
);