Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Threads / Activate.cpp
blob3b62a6044ad8894bbedfea1c3d084d9094a28b45
1 // Listing 1 code/ch12
2 #include "ace/Task.h"
3 #include "ace/OS_NS_unistd.h"
5 class HA_CommandHandler : public ACE_Task_Base
7 public:
8 virtual int svc ()
10 ACE_DEBUG
11 ((LM_DEBUG, ACE_TEXT ("(%t) Handler Thread running\n")));
12 ACE_OS::sleep (4);
13 return 0;
17 int ACE_TMAIN (int, ACE_TCHAR *[])
19 ACE_DEBUG
20 ((LM_DEBUG, ACE_TEXT ("(%t) Main Thread running\n")));
22 HA_CommandHandler handler;
23 int result = handler.activate ();
24 ACE_ASSERT (result == 0);
26 ACE_UNUSED_ARG (result);
28 handler.wait ();
29 return 0;
31 // Listing 1