1 #include "ace/config-lite.h"
2 #if defined (ACE_HAS_THREADS)
5 #include "ace/Log_Msg.h"
8 class HA_CommandHandler
: public ACE_Task
<ACE_MT_SYNCH
>
13 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("(%t) starting up\n")));
14 ACE_Message_Block
*mb
= 0;
15 if (this->getq (mb
) == -1)
17 // ... do something with the message.
22 // Listing 2 code/ch13
23 int ACE_TMAIN (int, ACE_TCHAR
*[])
25 HA_CommandHandler handler
;
28 handler
.activate (THR_NEW_LWP
| THR_JOINABLE
, 4);
35 #include "ace/OS_main.h"
36 #include "ace/OS_NS_stdio.h"
38 int ACE_TMAIN (int, ACE_TCHAR
*[])
40 ACE_OS::puts (ACE_TEXT ("This example requires threads."));
44 #endif /* ACE_HAS_THREADS */