int ACE_TMAIN (int, ACE_TCHAR *[]) { HA_CommandHandler handler; handler.activate (THR_NEW_LWP | THR_JOINABLE, 5); handler.wait (); return 0; }
int ACE_TMAIN (int, ACE_TCHAR *[]) { HA_Device_Repository rep; HA_CommandHandler handler (rep); handler.activate (THR_NEW_LWP | THR_JOINABLE, HA_CommandHandler::N_THREADS); handler.wait (); return 0; }
// Listing 2 code/ch13 int ACE_TMAIN (int, ACE_TCHAR *[]) { HA_ThreadHook hook; ACE_Thread_Hook::thread_hook (&hook); HA_CommandHandler handler; handler.activate (); handler.wait(); return 0; }
int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Main Thread running\n"))); // Listing 1 code/ch13 HA_CommandHandler handler; int result = handler.activate (THR_NEW_LWP | THR_JOINABLE | THR_SUSPENDED); ACE_ASSERT (result == 0); ACE_UNUSED_ARG (result); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) The current thread count is %d\n"), handler.thr_count ())); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) The group identifier is %d\n"), handler.grp_id ())); handler.resume (); handler.wait (); // Listing 1 return 0; }