Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Logging / Change_Instance_Default.cpp
blob3bf8daa32795e01229f754b86c018ec948330855
1 /**
2 * Sample code from The ACE Programmer's Guide,
3 * Copyright 2003 Addison-Wesley. All Rights Reserved.
5 * This code shows how to set the ACE_Log_Msg per-instance default
6 * differently for groups of spawned threads.
7 */
9 #include "ace/Log_Msg.h"
10 #include "ace/Thread_Manager.h"
12 ACE_THR_FUNC_RETURN worker (void *)
14 // do some work
15 return 0;
18 ACE_THR_FUNC_RETURN service (void *)
20 // run the service
21 return 0;
24 int ACE_TMAIN (int, ACE_TCHAR *[])
26 // Listing 1 code/ch03
27 ACE_LOG_MSG->priority_mask (0, ACE_Log_Msg::PROCESS);
28 ACE_Log_Msg::enable_debug_messages ();
29 ACE_Thread_Manager::instance ()->spawn (service);
30 ACE_Log_Msg::disable_debug_messages ();
31 ACE_Thread_Manager::instance ()->spawn_n (3, worker);
32 // Listing 1
33 ACE_Thread_Manager::instance ()->wait ();
34 return 0;