Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Bug_3321_Regression / main.cpp
blob3441bd1e3a7102e7ae1825aee89851999b3e5bd8
1 #include "tao/ORB.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/Thread.h"
4 #include "ace/os_include/os_pthread.h"
6 #include "tao/ORB.h"
7 #include "ace/Log_Msg.h"
8 #include "tao/AnyTypeCode/Any.h"
9 #include "tao/Policy_Manager.h"
10 #include "tao/TimeBaseC.h"
12 int result = 0;
14 ACE_THR_FUNC_RETURN main_orb(void*)
16 try
18 int argc = 0;
19 ACE_TCHAR **argv = 0;
20 CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
22 TimeBase::TimeT CONNECTION_TIMEOUT = 1000000;
23 TimeBase::TimeT ROUND_TRIP_TIMEOUT = 1000000;
25 if (!CORBA::is_nil(orb.in()))
27 ACE_DEBUG((LM_DEBUG, "ORB not nil\n"));
29 CORBA::Any connection_timeout_as_any;
30 connection_timeout_as_any <<= CONNECTION_TIMEOUT;
32 CORBA::Any rt_timeout_as_any;
33 rt_timeout_as_any <<= ROUND_TRIP_TIMEOUT;
35 orb->destroy ();
36 ACE_DEBUG((LM_DEBUG, "Destroyed ORB\n"));
39 catch(const ::CORBA::Exception& ex)
41 result = 1;
42 ex._tao_print_exception ("Exception caught:");
44 catch(...)
46 result = 1;
47 ACE_ERROR ((LM_ERROR, " (%P|%t) Unknown error\n"));
50 return 0;
54 int ACE_TMAIN(int, ACE_TCHAR*[])
56 ACE_hthread_t thread1;
57 # if defined (ACE_HAS_PTHREADS)
58 pthread_create(&thread1, 0, main_orb, 0);
59 #else
60 ACE_Thread::spawn (main_orb, 0, THR_NEW_LWP|THR_JOINABLE, 0, &thread1);
61 #endif
62 ACE_Thread::join( thread1);
64 return result;