Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / ThreadManagement / State.cpp
blob52b9845ca13c1e7195d1d4b6e5ea55b926ff9354
1 #include "ace/Task.h"
3 class HA_CommandHandler : public ACE_Task_Base
5 public:
6 virtual int svc ()
8 ACE_DEBUG
9 ((LM_DEBUG, ACE_TEXT ("(%t) Handler Thread running\n")));
10 return 0;
15 int ACE_TMAIN (int, ACE_TCHAR *[])
17 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Main Thread running\n")));
18 // Listing 1 code/ch13
19 HA_CommandHandler handler;
20 int result = handler.activate (THR_NEW_LWP |
21 THR_JOINABLE |
22 THR_SUSPENDED);
23 ACE_ASSERT (result == 0);
25 ACE_UNUSED_ARG (result);
27 ACE_DEBUG ((LM_DEBUG,
28 ACE_TEXT ("(%t) The current thread count is %d\n"),
29 handler.thr_count ()));
30 ACE_DEBUG ((LM_DEBUG,
31 ACE_TEXT ("(%t) The group identifier is %d\n"),
32 handler.grp_id ()));
33 handler.resume ();
34 handler.wait ();
35 // Listing 1
36 return 0;