Merge pull request #2316 from jwillemsen/jwi-taskcommenttypo
[ACE_TAO.git] / ACE / tests / Bug_3102_Regression_Test.cpp
blob724aa314af85e91d8772df7f3dc8136ddd0f4128
1 /**
2 * @file Bug_3102_Regression_Test.cpp
4 * Reproduces the problems reported in bug 3102
5 * http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=3102
6 */
8 #include "test_config.h"
9 #include "ace/ACE.h"
10 #include "ace/Trace.h"
11 #include "ace/Thread_Mutex.h"
12 #include "ace/Managed_Object.h"
13 #include "ace/Guard_T.h"
14 #include "ace/OS_NS_stdio.h"
16 #if defined (ACE_HAS_THREADS)
18 void mutexTest()
20 ACE_MT(ACE_Thread_Mutex *lock =
21 ACE_Managed_Object<ACE_Thread_Mutex>::get_preallocated_object
22 (ACE_Object_Manager::ACE_THREAD_EXIT_LOCK));
23 ACE_GUARD (ACE_Thread_Mutex, ace_mon, *lock);
25 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Mutex'd!\n")));
28 #endif /* ACE_HAS_THREADS */
30 int
31 run_main (int, ACE_TCHAR *[])
33 ACE_START_TEST (ACE_TEXT ("Bug_3102_Regression_Test"));
35 #if defined (ACE_HAS_THREADS)
36 ACE_Trace::start_tracing();
38 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Hello world!\n")));
40 mutexTest();
42 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Done!\n")));
44 ACE_Trace::stop_tracing();
45 #else
46 ACE_ERROR ((LM_INFO,
47 ACE_TEXT ("threads not supported on this platform\n")));
48 #endif /* ACE_HAS_THREADS */
50 ACE_END_TEST;
52 return 0;