diff options
author | wolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-12-21 21:58:13 +0000 |
---|---|---|
committer | wolff1 <wolff1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-12-21 21:58:13 +0000 |
commit | 899a895b2a1e5f6856cf2ca932717d4615140f02 (patch) | |
tree | 35dbb5b0cd84eed0e308f5ea1dac2c857fac4af9 | |
parent | 9feb8ea5e2d5845da0cdb0fc92ba81a38712a90a (diff) | |
download | ATCD-899a895b2a1e5f6856cf2ca932717d4615140f02.tar.gz |
Merged trunk changes r79939:80312 into branch TAO_Sequence_Iterators
398 files changed, 6847 insertions, 1327 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index e1562d523c3..ec45e765843 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,1141 @@ +Thu Dec 20 15:01:48 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tao/CSD_ThreadPool/CSD_TP_Task.h: + * tao/CSD_ThreadPool/CSD_TP_Task.inl: + + Resolved errors from the Borland compiler. + +Wed Dec 19 17:15:19 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tao/CSD_ThreadPool/CSD_TP_Task.h: + * tao/CSD_ThreadPool/CSD_TP_Task.inl: + * tao/CSD_ThreadPool/CSD_TP_Task.cpp: + + Fixed a bug in my prior check-in of this code. The case where the + thread calling close(1) is also a CSD ThreadPool thread was not + previously covered. + + * tests/CSD_Collocation/CSD_Collocation.mpc: + * tests/CSD_Collocation/Diamond_i.h: + * tests/CSD_Collocation/run_test.pl: + + Simplified the test down to one executable, no shared libraries. + + * tests/CSD_Collocation/diamond_export.h: + * tests/CSD_Collocation/stub_export.h: + + Removed these files. + +Wed Dec 19 09:31:59 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * orbsvcs/IFR_Service/IFR_Service.h: + * orbsvcs/IFR_Service/IFR_Server.cpp: + * orbsvcs/IFR_Service/IFR_Service.cpp: + Fixed bug 3175. + +Tue Dec 18 20:21:05 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/fe/fe_interface_header (check_concrete_supported_inheritance): + + Fixed bug in the logic of this method, which checks + valuetypes that support a concrete interface to make sure + that, if the supported interface has ancestors, that all + its ancestors are supported by the valuetype's ancestors. + +Tue Dec 18 14:38:22 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tests/CSD_Collocation/CSD_Collocation.mpc: + + Exclude this test from minimum CORBA. + +Tue Dec 18 12:09:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Queued_Message.{h,cpp,inl}: + Added new inline file + +Tue Dec 18 10:45:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_3171_Regression/*: + New regression provided by Joe Seward <joseph dot f dot seward at saic dot com> + for providing this test. This bug is not fixed yet. + +Tue Dec 18 10:11:20 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * orbsvcs/orbsvcs/IFRService/Options.cpp: + Fixed two memory leaks in Options::parse_args in handling + of string arguments. + +Tue Dec 18 07:53:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/CDR.{h,cpp,inl}: + * tao/Remote_Invocation.{h,cpp}: + Updated message_semantics + + * tao/DynamicAny/DynAny_i.cpp: + * tao/DynamicAny/DynEnum_i.cpp: + Added needed include to fix GCC 4 errors + + * orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp: + Reordered includes + +Mon Dec 17 20:02:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp + * orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h + * orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp + * orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h + * tao/IIOP_Transport.cpp + * tao/IIOP_Transport.h + * tao/Strategies/COIOP_Transport.cpp + * tao/Strategies/COIOP_Transport.h + * tao/Strategies/DIOP_Transport.cpp + * tao/Strategies/DIOP_Transport.h + * tao/Strategies/SCIOP_Transport.cpp + * tao/Strategies/SCIOP_Transport.h + * tao/Strategies/SHMIOP_Transport.cpp + * tao/Strategies/SHMIOP_Transport.h + * tao/Strategies/UIOP_Transport.cpp + * tao/Strategies/UIOP_Transport.h + * tao/Transport.cpp + * tao/Transport.h + Changed message_semantics to a real enum, this fixes bugzilla + 2992 + + * tao/Bind_Dispatcher_Guard.h: + * tao/Bind_Dispatcher_Guard.inl: + Changed status to TAO_Bind_Dispatcher_Status instead of int + + * tao/IIOP_Connection_Handler.cpp: + Const changes + + * tao/ORB.cpp: + Use true/false instead of 1/0 + + * tao/ORB.h: + Documentation change + + * tao/ORB_Core.cpp: + Layout change + + * tao/Resume_Handle.h: + Doxygen change + +Mon Dec 17 16:39:01 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tao/CSD_ThreadPool/CSD_TP_Task.cpp: + + Fixed a bug where the CSD ThreadPool would not get properly + re-initialized after destroying and re-initing the ORB. + + * tests/CSD_Collocation: + * tests/CSD_Collocation/CSD_Collocation.mpc: + * tests/CSD_Collocation/Collocation.cpp: + * tests/CSD_Collocation/Collocation_Tester.h: + * tests/CSD_Collocation/Collocation_Tester.cpp: + * tests/CSD_Collocation/Diamond.idl: + * tests/CSD_Collocation/Diamond_i.h: + * tests/CSD_Collocation/Diamond_i.cpp: + * tests/CSD_Collocation/README: + * tests/CSD_Collocation/diamond_export.h: + * tests/CSD_Collocation/run_test.pl: + * tests/CSD_Collocation/stub_export.h: + * tests/CSD_Collocation/svc.conf: + * tests/CSD_Collocation/svc.conf.csd: + * tests/CSD_Collocation/svc.conf.xml: + + Test case for this bug. + +Mon Dec 17 13:55:00 UTC 2007 Simon Massey <simon.massey@prismtech.com> + + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3174_Regression.mpc: + + REMOVE the redundant include path! + +Mon Dec 17 13:40:00 UTC 2007 Simon Massey <simon.massey@prismtech.com> + + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3174_Regression.mpc: + + CORRECT the mpc name! + +Mon Dec 17 12:35:00 UTC 2007 Simon Massey <simon.massey@prismtech.com> + + * orbsvcs/IFR_Service/ifr_adding_visitor.cpp + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3155_Regression.mpc: + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/ReadMe.txt: + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/run_test.pl: + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test.idl: + * orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test_idl.cpp: + + Fixed bugzilla 3174. + +Mon Dec 17 08:35:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp: + Fixed memory leaks in the SSLIOP implementation, thanks to + Venkat Sidhabathuni <venkats at idengines dot com> for providing + the patches. This fixes bugzilla 3165 + +Mon Dec 17 08:25:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp: + Fixed compile error + +Sun Dec 16 19:53:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h: + * orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h: + Doxygen changes + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp: + Const and layout changes + +Sun Dec 16 19:49:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * TAO_IDL/be/be_codegen.cpp: + * TAO_IDL/be/be_visitor_exception/exception_cs.cpp: + Always generate SystemException.h in the stub source file and + slightly changed the generated encode/decode operations. + This fixes bugzilla 3158, thanks to JT Conklin for reporting + this + +Fri Dec 14 02:48:57 CST 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * TAO version 1.6.2 released. + +Wed Dec 12 14:27:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Portable_Interceptors/Redirection/run_test.pl: + Improved this script for VxWorks + +Wed Dec 12 14:20:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Portable_Interceptors/Bug_3079/run_test.pl: + Fixed bug in VxWorks specific part of this script + +Wed Dec 12 13:22:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Big_Reply/server.cpp: + Added -t argument to specify the number of threads used in the + server. + +Tue Dec 11 21:11:16 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * NEWS: + Added bug fix in + + Tue Dec 11 20:31:39 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + +Tue Dec 11 20:37:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/TransportCurrent/lib/Current_Test_Lib.mpc: + * tests/TransportCurrent/Framework/run_test.pl: + * tests/TransportCurrent/IIOP/run_test.pl: + Install the test lib in the regular ACE_ROOT/lib directory, that + simplifies the perl scripts and fixes the test failures on + VxWorks + + * tests/LongDouble/run_test.pl: + Improved for VxWorks + + Tue Dec 11 20:31:39 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/fe/fe_declarator.cpp: + + Fixed bug in checking for illegal use of undefined forward + declared structs and unions. Thanks to Simon Massey + <Simon dot Massey at prismtech dot com> for reporting the + bug. + +Tue Dec 11 20:28:06 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * NEWS: + Added my checkins since the last beta. + +Tue Dec 11 20:13:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Two_Objects/client.cpp: + * tests/Two_Objects/run_test.pl: + * tests/Two_Objects/Second_i.cpp: + * tests/Two_Objects/server.cpp: + * tests/Two_Objects/worker.cpp: + * tests/Two_Objects/worker.h: + Let the client shutdown the server instead of having a fixed time + to run the ORB. This fixes the failing of this test on VxWorks + and slower systems. + +Tue Dec 11 18:55:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp: + Layout change + + * orbsvcs/tests/Security/Big_Request/client.cpp: + No need to pass in an empty ORB name + + * orbsvcs/tests/Security/Big_Request/server.cpp: + Added -t argument to specify the number of threads used in the + server. We observed that when using multiple threads the performance + of SSLIOP drops with a factor of about 20 times. With this + change we can retest this performance drop on all platforms + +Mon Dec 10 08:13:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/RTCORBA/RT_ORB.cpp: + * tao/RTCORBA/RT_ORB.h: + * tao/RTCORBA/RT_ORB_Loader.cpp: + * tao/RTCORBA/RT_ORBInitializer.cpp: + * tao/RTCORBA/RT_ORBInitializer.h: + * tao/RTCORBA/Thread_Pool.cpp: + * tao/RTCORBA/Thread_Pool.h: + * tao/RTCORBA/Thread_Pool.inl: + * docs/rtcorba/features.html: + Added new RTORBDynamicThreadRunTime which can be specified through + the RT_ORB_Loader. This requires a long argument which speficies the + number of microseconds the dynamic thread will run. After the time + has elapsed it will end automatically. + +Sat Dec 8 14:53:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/RTCORBA/Dynamic_Thread_Pool/run_test.pl: + No need to create a logfile on disk + + * tests/Server_Connection_Purging/run_test.pl: + Simplified this file + +Sat Dec 8 14:35:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/RTCORBA/Thread_Pool.cpp: + Use orb->run() for the dynamic threads that have an idle timeout, the + work_pending/perform_work loop causes signifant additional CPU load. We + do run the ORB for the specified idle timeout + + * tao/RTCORBA/Thread_Pool.h: + Layout changes + +Thu Dec 6 15:26:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: + Layout and const changes + +Thu Dec 6 15:10:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/BiDirectional/run_test.pl + * tests/Big_Oneways/run_test.pl + * tests/DIOP/run_test.pl + * tests/DIOP/run_test_ipv6.pl + * tests/MT_BiDir/run_test.pl + * tests/Nested_Event_Loop/run_test.pl + Don't use ORBDottedDecimalAddresses 1 on VxWorks, it is a workaround + for a DNS issue in the network stack + + * tests/Big_Oneways/run_test.pl + * tests/Big_Request_Muxing/Client_Task.cpp: + Layout change + + * tests/Big_Reply/server.cpp: + * tests/Big_Twoways/server.cpp: + Initialise pointer with 0 + + * tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc: + Added vc9 + + * tests/Smart_Proxies/Policy/run_test.pl: + Increased timeouts for VxWorks + +Wed Dec 5 14:49:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/IIOP_Connector.cpp: + * tao/RTCORBA/Thread_Pool.cpp: + Layout and const changes + +Tue Dec 4 18:53:08 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tests/Bug_2234_Regression/client.cpp: + + Used CORBA::ULong instead of integer literals to + index into IDL array vars. + +Tue Dec 4 15:41:37 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * docs/tutorials/Quoter/RTCORBA/Distributor_i.h: + * docs/tutorials/Quoter/RTCORBA/Stock_Database.h: + * orbsvcs/PSS/PSDL_Scope.cpp: + + Replaced ACE_Thread_Mutex with TAO_SYNCH_MUTEX to comply with TAO + coding standards and to silence fuzz warnings. + +Tue Dec 4 14:54:02 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tests/Bug_2234_Regression/Test.idl: + * tests/Bug_2234_Regression/client.cpp: + * tests/Bug_2234_Regression/server.cpp: + + Extended this test to also pass arrays (of variable-length elements) + and object references to ensure that the interceptors don't cause a + crash. This was fixed in bug 2852. + + * tests/Bug_3163_Regression/server.cpp: + + Use CORBA::ULong to index sequences, for 64-bit compatibility. + +Tue Dec 4 10:59:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + Only set the safe_rd when we have a transport + +Mon Dec 3 21:25:15 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_interface.cpp(gen_gperf_lookup_methods): + + - Added "Error:" prefix to error messages where it was missing, + so autobuilds can pick it up. Thanks to Will Otte + <wotte at dre dot vanderbilt dot edu> for the suggestion. + + - Added the exit code of the spawned gperf process to the error + message seen if ACE_Process::wait() returns unsuccessfully + after spawning gperf to generate the interface's operation table. + +Mon Dec 3 20:36:42 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp: + * orbsvcs/orbsvcs/IFRService/Container_i.cpp: + * orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp: + * orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp: + * orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp: + + Changes required to handling of base component and base valuetype + storage in the IFR resulting from changes in + + Thu Nov 29 23:58:21 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + +Mon Dec 3 19:39:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_3163_Regression/*: + New regression test, reworked version as provided by + Andre Kostur <akostur at incognito dot com> It runs perfect + on my Windows system, let the scoreboard show what happens + on other platforms + +Mon Dec 3 18:53:48 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h: + * orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp: + * orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h: + * orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp: + + Reverted unintended commit. + +Mon Dec 3 18:05:43 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h: + * orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp: + * orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h: + * orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp: + * orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h: + * orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp: + + Parts of TAO use TAO_SYNCH_MUTEX while other parts use ACE_SYNCH_MUTEX. + All occurrences of ACE_SYNCH_MUTEX were replaced with TAO_SYNCH_MUTEX for + consistency. + +Mon Dec 3 16:23:58 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * examples/CSD_Strategy/ThreadPool/OrbShutdownTask.h: + * examples/CSD_Strategy/ThreadPool2/OrbShutdownTask.h: + * examples/CSD_Strategy/ThreadPool3/OrbShutdownTask.h: + * examples/CSD_Strategy/ThreadPool4/OrbShutdownTask.h: + * examples/CSD_Strategy/ThreadPool5/OrbShutdownTask.h: + * examples/CSD_Strategy/ThreadPool6/OrbShutdownTask.h: + * examples/RTCORBA/Activity/Task_Stats.cpp: + * examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp: + * examples/RTScheduling/MIF_Scheduler/test.cpp: + * examples/RTScheduling/Task_Stats.cpp: + * orbsvcs/orbsvcs/AV/sfp.cpp: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp: + * orbsvcs/tests/Notify/lib/LookupManager.cpp: + * orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp: + * tests/Bug_2417_Regression/publisher_impl.cpp: + + Replaced ACE_Thread_Mutex with TAO_SYNCH_MUTEX to comply with TAO + coding standards and to silence fuzz warnings. + +Mon Dec 3 13:49:18 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * examples/CSD_Strategy/ThreadPool2/FooServantList.h: + * examples/CSD_Strategy/ThreadPool4/Foo_i.cpp: + * examples/CSD_Strategy/ThreadPool5/FooServantList.h: + * examples/CSD_Strategy/ThreadPool5/Foo_i.h: + * orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h: + * orbsvcs/Fault_Notifier/FT_Notifier_i.h: + * orbsvcs/examples/LoadBalancing/RPS_Monitor.h: + * orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp: + * orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h: + * orbsvcs/examples/Notify/Federation/Gate/Gate.h: + * orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h: + * orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp: + * orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h: + * orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp: + * orbsvcs/orbsvcs/Notify/Buffering_Strategy.h: + * orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp: + * orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h: + * orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp: + * orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h: + * orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp: + * orbsvcs/orbsvcs/Notify/Random_File.h: + * orbsvcs/orbsvcs/Notify/Random_File.cpp: + * orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h: + * orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp: + * orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h: + * orbsvcs/orbsvcs/Scheduler_Factory.cpp: + * orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h: + * orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp: + * orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h: + * orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp: + * orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h: + * performance-tests/CSD_Strategy/TestInf/AppShutdown.h: + * performance-tests/CSD_Strategy/TestInf/ClientEngine.h: + * performance-tests/CSD_Strategy/TestInf/ClientTask.h: + * performance-tests/RTCorba/Thread_Pool/client.cpp: + * tests/Big_Oneways/Session.h: + * tests/Big_Oneways/Session.cpp: + * tests/Big_Oneways/Session_Control.h: + * tests/Big_Oneways/Session_Control.cpp: + * tests/Big_Twoways/Session.h: + * tests/Big_Twoways/Session.cpp: + * tests/Big_Twoways/Session_Control.h: + * tests/Big_Twoways/Session_Control.cpp: + * tests/Bug_1020_Basic_Regression/Echo.h: + * tests/Bug_1020_Basic_Regression/Echo.cpp: + * tests/Bug_1361_Regression/Echo.h: + * tests/Bug_2805_Regression/client.cpp: + * tests/Bug_2909_Regression/client.cpp: + * tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h: + * tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h: + * tests/CSD_Strategy_Tests/TP_Common/ClientTask.h: + * tests/MT_BiDir/Receiver_i.cpp: + * tests/MT_BiDir/Sender_i.cpp: + * tests/Muxed_GIOP_Versions/server.cpp: + * tests/Muxing/Receiver.h: + * tests/Muxing/Receiver.cpp: + * tests/Stack_Recursion/Sender.h: + * tests/Stack_Recursion/Sender.cpp: + + Parts of TAO use TAO_SYNCH_MUTEX while other parts use ACE_SYNCH_MUTEX. + All occurrences of ACE_SYNCH_MUTEX were replaced with TAO_SYNCH_MUTEX for + consistency. + +Sun Dec 2 16:10:32 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h: + * tao/CSD_ThreadPool/CSD_TP_Request.h: + * tao/CSD_ThreadPool/CSD_TP_Servant_State.h: + * tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h: + * tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h: + * tao/MMAP_Allocator.h: + * tao/Messaging/AMH_Response_Handler.h: + * tao/RTCORBA/Thread_Pool.h: + * tao/RTCORBA/Thread_Pool.cpp: + + Parts of TAO use TAO_SYNCH_MUTEX while other parts use ACE_SYNCH_MUTEX. + All occurrences of ACE_SYNCH_MUTEX were replaced with TAO_SYNCH_MUTEX for + consistency. + +Sat Dec 1 17:41:00 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * tao/orbconf.h: + Disable fuzz check for ACE_SYNCH_MUTEX in a section of the code + were we define TAO_SYNCH_MUTEX in terms of ACE_SYNCH_MUTEX. + +Fri Nov 30 20:23:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Multiple/client.cpp: + * tests/Multiple/run_test.pl: + * tests/Multiple/server.cpp: + Pass IOR filename through the commandline + +Fri Nov 30 14:10:00 UTC 2007 Simon Massey <sma@prismtech.com> + + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl: + + Correct TAO_ROOT's. + +Fri Nov 30 11:50:00 UTC 2007 Simon Massey <sma@prismtech.com> + + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc: + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt: + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl: + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl: + * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp: + + Removed new regression test (wrong place) + +Fri Nov 30 11:43:00 UTC 2007 Simon Massey <sma@prismtech.com> + + * tests/Bug_3155_Regression/Bug_3155_Regression.mpc: + * tests/Bug_3155_Regression/ReadMe.txt: + * tests/Bug_3155_Regression/run_test.pl: + * tests/Bug_3155_Regression/test.idl: + * tests/Bug_3155_Regression/test_idl.cpp: + + Removed new regression test (wrong place) + +Fri Nov 30 06:42:17 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com> + + * tests/Bug_2953_Regression/run_test.pl: + + Fix typo in error message. + +Fri Nov 30 00:38:11 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com> + + * TAO_IDL/be/be_visitor_template_export.cpp: + * examples/RTScheduling/Task_Stats.inl: + * orbsvcs/tests/unit/Notify/MC/Statistic/Statistic.cpp: + * tao/Codeset/Codeset_Translator_Factory_T.cpp: + * tests/Bug_2677_Regression/server.cpp: + * tests/Bug_2735_Regression/server.cpp: + * tests/Bug_2936_Regression/bug2936.cpp: + * tests/Param_Test/options.cpp: + + Add #include "ace/Log_Msg.h". + + * tao/AnyTypeCode/Struct_TypeCode.cpp: + * tao/PolicyC.cpp: + + Add #include "tao/SystemException.h" + + * tao/DiffServPolicy/Server_Network_Priority_Policy.cpp: + * tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp: + * tao/IORManipulation/IORManip_IIOP_Filter.cpp: + * tao/Messaging/AMI_Arguments_Converter_Impl.cpp: + * tao/Messaging/ExceptionHolder_i.cpp: + + Add #include "tao/CDR.h" + + * tao/DynamicAny/DynUnion_i.cpp: + + Add #include "tao/DynEnum_i.h" + + * tao/GIOP_Message_Base.h: + * tao/Invocation_Base.h: + * tao/Messaging/AMH_Response_Handler.h: + * tao/operation_details.h: + + Add #include "tao/Exception.h" + + * tao/Request_Dispatcher.h: + + Add #include "tao/TAO_Export.h" + + * orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/NotificationServiceMonitor.cpp: + * orbsvcs/tests/unit/Notify/MC/Statistic_Registry/Statistic_Registry.cpp: + + Add #include "tao/TAO_Singleton_Manager.h" + + * tests/Bug_1383_Regression/SimpleClient.cpp: + * tests/Portable_Interceptors/Bug_2510_Regression/client.cpp: + + Add #include "ace/Thread.h" + + * tests/Param_Test/anyop.cpp: + + Add #include "tao/Stub.h" + + These headers are included implicitly by template *.cpp files on + platforms where ACE_TEMPLATES_REQUIRE_SOURCE, but are needed for + those that don't. + +Thu Nov 29 23:58:21 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp: + * orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp: + * orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp: + * orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp: + + Fixed bug in storing parent information in the IFR for types + with a single parent (valuetypes and components). Thanks to + Simon Massey <simon dot massey at prismtech dot com> for reporting + the problem with valuetypes. + +Thu Nov 29 16:58:00 UTC 2007 Simon Massey <sma@prismtech.com> + + * tests/Bug_3155_Regression/Bug_3155_Regression.mpc: + * tests/Bug_3155_Regression/ReadMe.txt: + * tests/Bug_3155_Regression/run_test.pl: + * tests/Bug_3155_Regression/test.idl: + * tests/Bug_3155_Regression/test_idl.cpp: + + Create new regression test. + +Thu Nov 29 14:58:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Transport.cpp: + Fixed GCC warning when ACE_INITIALIZE_MEMORY_BEFORE_USE is defined + +Thu Nov 29 14:46:49 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tao/PortableServer/Root_POA.cpp: + Fixed a memory leak described by Bug#3151. However, it's + difficult to provide an automated test for this bug since + it lies in refcounting of root POA. + +Thu Nov 29 04:23:58 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> + + * tests/DSI_AMH/Roundtrip.cpp: + * tests/DSI_AMI_Gateway/test_dsi.cpp: + Fix to the ServerRequest argument ownership to avoid a double + delete situation which crashes these tests on HPUX. + +Wed Nov 28 12:59:33 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tests/Bug_3154_Regression/orbsvcs/CosNotification.idl: + * tests/Bug_3154_Regression/test.idl: + * tests/Bug_3154_Regression/run_test.pl: + Added Id to these files to make fuzz check happy. + +Wed Nov 28 10:42:20 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tests/Bug_3154_Regression/orbsvcs/CosNotification.idl: + * tests/Bug_3154_Regression/test.idl: + * tests/Bug_3154_Regression/run_test.pl: + * tests/Bug_3154_Regression/README: + * TAO_IDL/include/idl_global.h: + * TAO_IDL/be/be_global.cpp: + * TAO_IDL/be_include/be_global.h: + * TAO_IDL/fe/fe_init.cpp: + * TAO_IDL/driver/drv_preproc.cpp: + * TAO_IDL/util/utl_global.cpp: + Added a test and implementation of the feature described + by Bug#3154. + +Wed Nov 28 07:33:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/LoadBalancer/Signal_Handler.{h,cpp}: + Updated activate method because of new argument in the base + class + +Tue Nov 27 16:02:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: + Layout changes and improved some debug messages + +Tue Nov 27 15:56:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Connection_Handler.cpp: + * tao/Leader_Follower_Flushing_Strategy.cpp: + Layout changes + + * tao/IIOP_Transport.cpp: + * tao/Transport.cpp: + Layout changes and improved some debug messages + + * tao/Thread_Per_Connection_Handler.cpp: + * tao/Thread_Per_Connection_Handler.h: + No need to use ACE_Task<>, just use ACE_Task_Base, we don't need + the message queue. Also removed the activate method, just use the + method from the base + +Tue Nov 27 14:55:14 UTC 2007 Jeff Parsons <j.parsons@vanderbilt.edu> + + * examples/AMI/FL_Callback/FL_Callback.mpc: + + Added explicit lists of header and inline files to the project. + +Tue Nov 27 11:20:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/DynamicInterface/DII_Invocation.cpp: + * tao/DynamicInterface/DII_Invocation.h: + * tao/DynamicInterface/DII_Invocation_Adapter.cpp: + * tao/Invocation_Adapter.cpp: + * tao/Invocation_Endpoint_Selectors.cpp: + * tao/Messaging/Asynch_Invocation.cpp: + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + * tao/Profile_Transport_Resolver.cpp: + * tao/Synch_Invocation.cpp: + * tao/Synch_Invocation.h: + Reworked the fix for bug 2133/3079/3080 in such a way that the + Transport Current code is working again (see bug 3127) + +Tue Nov 27 06:33:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/AV/UDP.cpp: + * orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp: + Don't use the deprecated ACE_SOCK_Dgram_Mcast methods + +Mon Nov 26 19:31:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/IOR_Multicast.cpp: + Don't use the deprecated ACE_SOCK_Dgram_Mcast methods + +Fri Nov 23 20:32:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/Strategies/SHMIOP_Transport.cpp: + * tao/Strategies/UIOP_Transport.cpp: + Corrected debug statements + +Fri Nov 23 19:33:54 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/Naming/Naming_Server.cpp: + Prefix increment + + * orbsvcs/orbsvcs/SSLIOP.mpc: + Updated for vc9 + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: + Corrected debug statement + + * tao/SystemException.cpp: + Prefix decrement + + * tests/CodeSets/simple/client.cpp: + No need to pass an empty orb name + + * tests/Param_Test/server.cpp: + Layout change + +Thu Nov 22 05:32:24 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com> + + * tests/Bug_1551_Regression/server.cpp: + * tests/Bug_2503_Regression/server.cpp: + + Fetch the high res timer's global scale factor to ensure it is + calibrated (if necessary on this platform) at the beginning of + the test. While the timer would otherwise be calibrated on + first use, this introduces delay in the middle of the test's + execution. This leads to failures due to timing assumptions + (timeouts, etc.) within the test itself. + +Thu Nov 22 04:54:58 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com> + + * orbsvcs/orbsvcs/Makefile.am: + + Add conditionals needed to add ZLIB/ZZIP libraries for + TAO_CosNotification_Persist library iff used by build. + +Thu Nov 15 20:37:24 UTC 2007 Ciju John <johnc at ociweb dot com> + + * orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h: + * orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp: + Work around for bug 2980. Create the MC ORB in the parent thread + and pass to the ORBTask. + Setup a barrier to synch the parent and child threads. This + holds the parent thread till child initialization is completed. + +Wed Nov 14 18:52:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/TransportCurrent/lib/Client_Request_Interceptor.cpp: + Don't try to catch NoContext, TC is broken at this moment after the change + of Mon Nov 12 08:54:21 UTC 2007. Will work on a revised change + which also should make the change to this test not needed. The + test will then fail on the scoreboard until the change is in + the repo. + +Wed Nov 14 12:42:08 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp: + Fixed 2 memory leaks that was happening because the value + returned by activate_server_i(...) was ignored. + +Tue Nov 13 22:27:17 UTC 2007 Adam Mitz <mitza@ociweb.com> + + * tao/TransportCurrent/IIOP_Current_Impl.h: + * tao/TransportCurrent/IIOP_Current_Impl.cpp: + + Updated comments to reflect the implementation changes in: + Mon Nov 12 08:54:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + +Mon Nov 12 17:54:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/LongUpcalls/run_test.pl: + * tests/Multiple/run_test.pl: + Improved for VxWorks + +Mon Nov 12 17:44:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/CodeSets/simple/run_test.pl: + Added support for VxWorks cross platform testing + + * tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: + Simplified this script + +Mon Nov 12 13:59:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2174_Regression/run_test.pl: + * tests/Bug_2183_Regression/run_test.pl: + * tests/Bug_2234_Regression/run_test.pl: + * tests/Bug_2328_Regression/run_test.pl: + * tests/Bug_2804_Regression/run_test.pl: + Improved VxWorks cross platform testing + +Mon Nov 12 13:02:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_1361_Regression/run_test.pl: + Use PerlACE::wait_interval_for_process_creation + +Mon Nov 12 11:48:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2289_Regression/run_test.pl: + Added support for VxWorks cross platform testing + + * tests/Bug_2936_Regression/run_test.pl: + * tests/Bug_2953_Regression/run_test.pl: + Simplified these files + +Mon Nov 12 09:48:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2869_Regression/run_test.pl: + Simplified this file + +Mon Nov 12 09:25:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2734_Regression/*: + Build client/server here instead of using them from a different test. + Fixes issues on VxWorks + +Mon Nov 12 08:54:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + Changed the way how portable interceptors relate to connection + establishment. A few years ago the connection was setup after the + send_request client interceptor call, this was changed with some + refactoring. The send_request was now called after the connection + establishment, as a result, if the connection establishment failed, + the receive_exception method on the client request interceptor + wasn't called. With this behaviour it is not possible to implement + a FT app with just interceptors, you need a TAO specific endpoint + selector. The change I made is to move the connection establishment + after the send_request. As a result in the send_request it can + happen that there is no transport selected, at that moment + retrieving transport current (which is TAO specific) will give a + NoContext exception. + + This fixes bugzilla 2133, 3079, and 3080. Thanks to Simon McQueen + and Jaiganesh Balasubramanian for reporting these issues. + + * tao/Synch_Invocation.cpp: + * tao/Synch_Invocation.h: + * tao/Messaging/Asynch_Invocation.cpp: + Moved the resolve on the profile_transport_resolver to after the + send_request. At the moment a transport has been selected the + virtual method transport_resolved() is called so that derived + classes can set additional values on the transport. + + * tao/Remote_Invocation.{h,cpp} (write_header): + Setup TAO_Target_Specification within this method, no need to + pass it in as argument + + * tao/DynamicInterface/DII_Invocation.{h,cpp}: + Use the new transport_resolved to set the transport in the safe_rd and + reset the byter order, at the moment the remote_invocation is called + it is possible that the transport is not resolved yet + + * tao/DynamicInterface/DII_Invocation_Adapter.cpp: + Don't reset the byte order here, do that in DII_Invocation + + * tao/Invocation_Adapter.cpp: + Const changes, layout changes and don't resolve the transport here, + do that in the Remote_Invocation derived classes + + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + Don't schedule the timer here, but in the Async_Invocation because we + maybe haven't resolved the transport. + + * tao/TransportCurrent/IIOP_Current_Impl.cpp: + When we have no transport or no connection handler return a NoContext + instead of No_Implement + + * tao/Object.cpp: + Fixed typo in comment + + * tests/TransportCurrent/Framework/Current_Test_Impl.cpp: + * tests/TransportCurrent/lib/Client_Request_Interceptor.cpp: + * tests/TransportCurrent/lib/Client_Request_Interceptor.h: + Updated for the fact that send_request could throw NoContext + + * tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp: + Layout changes + + * tao/Utils/ORB_Manager.cpp: + Destroy the ORB in the destructor + + * tests/Portable_Interceptors/Bug_3079/run_test.pl: + Small updates + +Mon Nov 12 08:12:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2234_Regression/run_test.pl: + Extended timeout for VxWorks + + * tests/Leader_Followers/run_test.pl: + * tests/Leader_Followers/select_mt.conf: + * tests/Leader_Followers/tp.conf: + Updated for VxWorks + + * tests/CollocationLockup/CollocationLockup.cpp: + Wait explicitly on the thread manager and shutdown the ORB to + fix some memory leaks + +Sun Nov 11 20:15:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp: + Layout change + + * tests/Servant_To_Reference_Test/run_test.pl: + Improved for VxWorks + + * tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl: + Corrected for VxWorks + +Sun Nov 11 19:55:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2174_Regression/run_test.pl + * tests/Bug_2319_Regression/run_test.pl + * tests/Bug_2792_Regression/run_test.pl + * tests/Bug_2795_Regression/run_test.pl + * tests/Bug_2809_Regression/run_test.pl + * tests/Bug_2935_Regression/run_test.pl + * tests/IORManipulation/run_test.pl + * tests/ORB_destroy/run_test.pl + * tests/ORB_init/run_test.pl + * tests/POA/Deactivate_Object/run_test.pl + * tests/POA/wait_for_completion/run_test.pl + Added support for VxWorks cross platform testing and simplified + the files + +Sun Nov 11 19:15:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/IORManipulation/filter/run_test.pl: + Added support for VxWorks cross platform testing + +Sun Nov 11 19:08:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2809_Regression/run_test.pl: + Added support for VxWorks cross platform testing + +Sun Nov 11 19:06:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2345_Regression/run_test.pl: + Added support for VxWorks cross platform testing + +Sun Nov 11 19:04:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2319_Regression/run_test.pl: + Added support for VxWorks cross platform testing + +Sun Nov 11 19:01:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Bug_2134_Regression/run_test.pl: + Added support for VxWorks cross platform testing + +Fri Nov 9 11:29:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp: + Removed msvc6 workaround and layout changes + + * orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp: + * orbsvcs/orbsvcs/Notify/MonitorControl/Statistic.h: + * orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h: + Layout changes + + * orbsvcs/tests/FT_App/FT_TestReplica_i.cpp: + Fixed GCC 4.2 warnings + +Fri Nov 9 09:04:21 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/TAO_Singleton_Manager.cpp: + dynamically_allocated is a bool + + * tao/PI/PI.cpp: + * tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.{h,cpp}: + * tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp: + Layout changes + + * tao/ORBInitializer_Registry.cpp: + With VxWorks and TSS emulation enabled we do need to search the + global registry because the loader which creates the global registry + is a different thread then the thread that executes main + +Wed Nov 7 18:48:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tests/Portable_Interceptors/Bug_2133/*: + New regression test for bug 2133, thanks to Simon McQueen for + creating this test + + * testsPortable_Interceptors/Bug_3080/server.cpp: + Fixed memory leak in this test + + * tests/Blocking_Sync_None/run_test.pl: + Added support for -debug which adds -ORBDebugLevel 10 to the + executables + +Wed Nov 7 15:40:23 UTC 2007 Jaiganesh B <jai@shiva.dre.vanderbilt.edu> + + * tests/Portable_Interceptors/Bug_3079/Client_Request_Interceptor.cpp: + + Modified the ACE_DEBUG statements to use the word "exception" + instead of the word "EXCEPTION" which is interpreted by the + autobuilds as a test failure. + +Wed Nov 7 15:33:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/IORManipulation/IORManipulation.cpp: + Layout changes + + * tao/Object.cpp: + Fixed comment + +Wed Nov 7 15:30:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp: + Shutdown the orb to fix some memory leaks and layout changes + +Wed Nov 7 14:58:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/Mobility_Service: + Removed, empty + + * orbsvcs/Naming_Service/NT_Naming_Service.cpp: + Layout change + + * tests/NestedUpcall/MT_Client_Test/client.cpp: + * tests/NestedUpcall/MT_Client_Test/local_server.cpp: + Fixed incorrect ACE_ERROR_RETURN statements. This test is now + failing on svn head, it doesn't do a correct cleanup and should + be improved much more + + * tests/NestedUpcall/MT_Client_Test/run_test.pl: + Simplified + + * tests/POA/Default_Servant2/client.cpp: + Layout change + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp: + Use ACE_ERROR for errors, prefix increment + +Tue Nov 6 15:59:43 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp: + Fixed a memory leak with improper order of cleanup. + +Tue Nov 6 15:51:01 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * examples/RTCORBA/Activity/Job.idl: + * examples/RTCORBA/Activity/Activity.h: + * examples/RTCORBA/Activity/POA_Holder.cpp: + * examples/RTCORBA/Activity/POA_Holder.h: + * examples/RTCORBA/Activity/Builder.cpp: + * examples/RTCORBA/Activity/Activity.cpp: + * examples/RTCORBA/Activity/run_test.pl: + Fixed a lot of memory leaks in this example. + Mon Nov 5 16:30:00 UTC 2007 Simon Massey <simon.massey@prismtech.com> * orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp: @@ -3,6 +3,44 @@ PLANNED MAJOR CHANGES "SOMETIME IN THE FUTURE" (i.e., exact beta not known) . (Remedy) Add ZIOP support +USER VISIBLE CHANGES BETWEEN TAO-1.6.1 and TAO-1.6.2 +==================================================== + +. Added support for handling Location Forward exceptions caught when using + AMI with DSI. These exceptions may also be raised from within DSI servants + using AMH. + +. Added -RTORBDynamicThreadRunTime which controls the lifetime of dynamic + RTCORBA threads + +. Changed the PI code so that send_request is also called at the moment + we don't have a transport (bugzilla 2133) + +. Fixed memory leak that occured for each thread that was making CORBA + invocations + +. Updated several tests to work correctly on VxWorks + +. Removed support for pluggable messaging. As a result the code in the + core of TAO is much cleaner and we are about 5 to 10% faster + +. Improved CORBA/e support + +. Added gperf's exit code to the error message output if it exits + unsuccessfully when spawned by the IDL compiler to generate an + interface's operation table + +. Fixed bug in Interface Repository's handling of base valuetypes + and base components (Bugzilla 3155) + +. Fixed code generation bug that occurs when there is both a C++ + keyword clash in the IDL and AMI 'implied IDL' code generation + +. Fixed IDL compiler bug wherein some cases of illegal use of a + forward declared struct or union wasn't caught + +. Improved support for VxWorks 6.4 kernel and rtp mode + USER VISIBLE CHANGES BETWEEN TAO-1.6 and TAO-1.6.1 ==================================================== @@ -11,10 +49,6 @@ USER VISIBLE CHANGES BETWEEN TAO-1.6 and TAO-1.6.1 . Fixed invalid code generation by the IDL compiler when the options -Sa -St and -GA are combined -. Added support for handling Location Forward exceptions caught when using - AMI with DSI. These exceptions may also be raised from within DSI servants - using AMH. - USER VISIBLE CHANGES BETWEEN TAO-1.5.10 and TAO-1.6 ===================================================== diff --git a/TAO/PROBLEM-REPORT-FORM b/TAO/PROBLEM-REPORT-FORM index 8b8ef0b1b0b..4e19c03f671 100644 --- a/TAO/PROBLEM-REPORT-FORM +++ b/TAO/PROBLEM-REPORT-FORM @@ -43,8 +43,8 @@ To: tao-bugs@cs.wustl.edu Subject: [area]: [synopsis] - TAO VERSION: 1.6.1 - ACE VERSION: 5.6.1 + TAO VERSION: 1.6.2 + ACE VERSION: 5.6.2 HOST MACHINE and OPERATING SYSTEM: If on Windows based OS's, which version of WINSOCK do you diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index af366f787fb..3471ef38c3a 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -175,13 +175,13 @@ TAO_CodeGen::start_client_header (const char *fname) "dds/DCPS/Serializer.h", this->client_header_ ); - + // Generate the includes of tao version sequence header. this->client_header_->print ("\n#include \"tao/%s\"", fname); // Add #if 0 to disable TAO specific code - *this->client_header_ << be_nl << be_nl + *this->client_header_ << be_nl << be_nl << "#if 0 // disable TAO specific code" << be_nl << be_nl; } @@ -245,7 +245,7 @@ TAO_CodeGen::start_client_header (const char *fname) << "#endif /* ACE_LACKS_PRAGMA_ONCE */"; *this->client_header_ << be_nl; - + // So the ostream operator header will be visible in included ORB files. if (be_global->gen_ostream_operators ()) { @@ -255,7 +255,7 @@ TAO_CodeGen::start_client_header (const char *fname) } *this->client_header_ << be_nl; - + // Other include files. if (be_global->stub_export_include () != 0) @@ -293,10 +293,10 @@ TAO_CodeGen::start_client_header (const char *fname) if (be_global->gen_dcps_type_support ()) { - // When -Gdcps is enabled, if the "tao/*Seq.pidl" is + // When -Gdcps is enabled, if the "tao/*Seq.pidl" is // included in a DDS idl file then the generated code // will include the dds version idl generated code. - if (ACE_OS::strstr (idl_name, "tao/") == idl_name + if (ACE_OS::strstr (idl_name, "tao/") == idl_name && ACE_OS::strstr (idl_name, "Seq.pidl")) { idl_name[0] = 'd'; @@ -855,7 +855,7 @@ int TAO_CodeGen::start_anyop_header (const char *fname) { // We may want to generate the full file or generate an empty - // one, but this is the only condition under which we want to + // one, but this is the only condition under which we want to // skip it completely. if (!be_global->gen_anyop_files () && !be_global->gen_empty_anyop_header ()) { @@ -886,9 +886,9 @@ TAO_CodeGen::start_anyop_header (const char *fname) "Error opening file\n"), -1); } - + // We want the empty file not only with -GX - // but also when -GA appears with -Sa or -St. + // but also when -GA appears with -Sa or -St. bool gen_empty_file = be_global->gen_empty_anyop_header () || be_global->gen_anyop_files () && !be_global->any_support (); @@ -1059,9 +1059,7 @@ TAO_CodeGen::start_anyop_source (const char *fname) -1); } - if (this->anyop_source_->open (fname, - TAO_OutStream::TAO_CLI_IMPL) - == -1) + if (this->anyop_source_->open (fname, TAO_OutStream::TAO_CLI_IMPL) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "TAO_CodeGen::start_anyop_source - " @@ -1253,8 +1251,8 @@ TAO_CodeGen::end_client_header (void) if (be_global->gen_dcps_type_support_only ()) { - *this->client_header_ << be_nl << be_nl - << "#endif /* end of disabling TAO specific code */" + *this->client_header_ << be_nl << be_nl + << "#endif /* end of disabling TAO specific code */" << be_nl << be_nl; } @@ -1885,7 +1883,7 @@ TAO_CodeGen::gen_stub_hdr_includes (void) // On some platforms, this include isn't needed if certain command // line options are present. Rather than try to sort that all out, // and to keep cross-compiling robust, we always generate this - // include if gen_ostream_operators_ is true. + // include if gen_ostream_operators_ is true. if (be_global->gen_ostream_operators ()) { this->gen_standard_include (this->client_header_, @@ -1929,10 +1927,10 @@ TAO_CodeGen::gen_stub_src_includes (void) if (be_global->gen_dcps_type_support_only ()) { - *this->client_stubs_ << "\n\n#if 0 // disable TAO specific code " + *this->client_stubs_ << "\n\n#if 0 // disable TAO specific code " << be_nl << be_nl; } - + // Always generated. this->gen_standard_include (this->client_stubs_, "tao/CDR.h"); @@ -2002,11 +2000,7 @@ TAO_CodeGen::gen_stub_src_includes (void) // The UserException::_tao_{en,de}code() methods can throw a // CORBA::MARSHAL exception so make sure that system exception is // fully declared/defined by including "tao/SystemException.h". - // However, only include "tao/SystemException.h" if a user exception - // was encountered and if we're not already including it in the stub - // header. - if (idl_global->exception_seen_ - && !idl_global->operation_seen_) + if (idl_global->exception_seen_) { this->gen_standard_include (this->client_stubs_, "tao/SystemException.h"); @@ -2035,7 +2029,7 @@ TAO_CodeGen::gen_stub_src_includes (void) this->gen_standard_include (this->client_stubs_, "ace/OS_NS_string.h"); } - + if (be_global->gen_amh_classes ()) { // Necessary for the AIX compiler. diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 5debd35b6b6..23d5441cd95 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -111,7 +111,8 @@ BE_GlobalData::BE_GlobalData (void) gen_local_iface_anyops_ (true), use_clonable_in_args_ (false), gen_template_export_ (false), - gen_ostream_operators_ (false) + gen_ostream_operators_ (false), + gen_custom_ending_ (true) { } @@ -253,6 +254,9 @@ BE_GlobalData::be_get_client_hdr (UTL_String *idl_file_name, ACE_CString fn (idl_file_name->get_string ()); ACE_CString fn_ext = fn.substr (fn.length () - 5); bool orb_file = (fn_ext == ".pidl" || fn_ext == ".PIDL"); + if (!orb_file && !be_global->gen_custom_ending () && + idl_global->validate_orb_include (idl_file_name)) + orb_file = true; return be_change_idl_file_extension (idl_file_name, orb_file @@ -285,6 +289,9 @@ BE_GlobalData::be_get_server_hdr (UTL_String *idl_file_name, ACE_CString fn (idl_file_name->get_string ()); ACE_CString fn_ext = fn.substr (fn.length () - 5); bool orb_file = (fn_ext == ".pidl" || fn_ext == ".PIDL"); + if (!orb_file && !be_global->gen_custom_ending () && + idl_global->validate_orb_include (idl_file_name)) + orb_file = true; return be_change_idl_file_extension (idl_file_name, orb_file @@ -1598,6 +1605,18 @@ BE_GlobalData::gen_local_iface_anyops (bool val) this->gen_local_iface_anyops_ = val; } +bool +BE_GlobalData::gen_custom_ending (void) const +{ + return this->gen_custom_ending_; +} + +void +BE_GlobalData::gen_custom_ending (bool val) +{ + this->gen_custom_ending_ = val; +} + ACE_CString BE_GlobalData::spawn_options (void) { @@ -2321,6 +2340,12 @@ BE_GlobalData::parse_args (long &i, char **av) )); } } + else if (av[i][2] == 'e') + { + // disable custom file endings for included idl/pidl + // files from TAO specific include paths. + be_global->gen_custom_ending (false); + } else { ACE_ERROR (( @@ -2880,6 +2905,15 @@ BE_GlobalData::usage (void) const ACE_TEXT (" -Sorb\t\t\tsuppress generating include of ORB.h") ACE_TEXT (" (disabled by default)\n") )); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT (" -Se\t\t\tdisable custom file ending for included") + ACE_TEXT (" idl/pidl files\n\t\t\t") + ACE_TEXT ("that are found in TAO specific includes directories,\n\t\t\t") + ACE_TEXT ("(i.e. $TAO_ROOT, $TAO_ROOT/tao, $TAO_ROOT/orbsvcs,\n\t\t\t") + ACE_TEXT ("$TAO_ROOT/CIAO, $TAO_ROOT/CIAO/ciao)") + ACE_TEXT (" (enabled by default)\n") + )); } AST_Generator * diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index aef021125ce..d3613e446eb 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -1701,7 +1701,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) if (ACE_OS::fclose (tao_cg->gperf_input_stream ()->file ()) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "%p:File close failed on temp gperf's input file\n", + "Error:%p:File close failed on temp gperf's input file\n", "fclose"), -1); } @@ -1723,7 +1723,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) if (input == ACE_INVALID_HANDLE) { ACE_ERROR_RETURN ((LM_ERROR, - "%p:File open failed on gperf's temp input file\n", + "Error:%p:File open failed on gperf's temp input file\n", "open_temp_file"), -1); } @@ -1764,7 +1764,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) { ACE_OS::close (input); ACE_ERROR_RETURN ((LM_ERROR, - "%p:File open failed on server skeleton file\n", + "Error:%p:File open failed on server skeleton file\n", "open"), -1); } @@ -1858,25 +1858,29 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name) if (result != -1) { + result = process.spawn (process_options); + // Spawn a process for gperf. - if (process.spawn (process_options) == -1) + if (result == -1) { ACE_ERROR ((LM_ERROR, - "Error:%p:Couldnt spawn a process for gperf program\n", - "process.spawn")); - - result = -1; + "Error:%p:Couldn't spawn a " + "process for gperf program\n")); } // Wait for gperf to complete. - else if (process.wait () == -1) + else { - ACE_ERROR ((LM_ERROR, - "Error:%p:Error on waiting for " - "completion of gperf program.\n", - "process.wait")); - - result = -1; + ACE_exitcode exitcode; + result = process.wait (&exitcode); + + if (result == -1) + { + ACE_ERROR ((LM_ERROR, + "Error:%p:gperf program " + "returned exit code %d.\n", + exitcode)); + } } // Adjust the file offset to the EOF for the server skeleton diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp index 8060bc61a8d..5af3eaedb71 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -245,12 +245,10 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) { *os << "TAO_OutputCDR &cdr) const" << be_nl << "{" << be_idt_nl - << "if (cdr << *this)" << be_idt_nl + << "if (!(cdr << *this))" << be_idt_nl << "{" << be_idt_nl - << "return;" << be_uidt_nl - << "}" << be_uidt_nl << be_nl; - - *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl; + << "throw ::CORBA::MARSHAL ();" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; } @@ -271,12 +269,10 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) { *os << "TAO_InputCDR &cdr)" << be_nl << "{" << be_idt_nl - << "if (cdr >> *this)" << be_idt_nl + << "if (!(cdr >> *this))" << be_idt_nl << "{" << be_idt_nl - << "return;" << be_uidt_nl - << "}" << be_uidt_nl << be_nl; - - *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl; + << "throw ::CORBA::MARSHAL ();" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; } diff --git a/TAO/TAO_IDL/be/be_visitor_template_export.cpp b/TAO/TAO_IDL/be/be_visitor_template_export.cpp index 6fb14458121..38a607b29bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_template_export.cpp +++ b/TAO/TAO_IDL/be/be_visitor_template_export.cpp @@ -19,6 +19,7 @@ #include "be_extern.h" #include "be_helper.h" #include "be_predefined_type.h" +#include "ace/Log_Msg.h" ACE_RCSID (be, be_visitor_template_export, diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index c46d3fdfe8a..0c0fe0eaa8e 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -574,6 +574,10 @@ public: void gen_local_iface_anyops (bool val); // Accessors for the member gen_local_iface_anyops_. + bool gen_custom_ending (void) const; + void gen_custom_ending (bool val); + // Accessors for the member gen_custom_ending_. + ACE_CString spawn_options (void); // Command line passed to ACE_Process::spawn. Different // implementations in IDL and IFR backends. @@ -818,6 +822,11 @@ private: bool gen_ostream_operators_; // Generate ostream operators for each type declaration, for // debuggin or logging. + + bool gen_custom_ending_; + // True by default, but a command line option can turn this off so + // custom ending will not be applied to files in $TAO_ROOT/, + // $TAO_ROOT/tao, $TAO_ROOT/orbsvcs, $TAO_ROOT/CIAO, $TAO_ROOT/CIAO/ciao. }; #endif /* _BE_GLOBAL_H */ diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 05489716ebf..748fb1af461 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -269,6 +269,8 @@ DRV_cpp_init (void) char* TAO_ROOT = ACE_OS::getenv ("TAO_ROOT"); + // When adding new dirs here don't forget to update + // IDL_GlobalData::validate_orb_include accordingly. if (TAO_ROOT != 0) { DRV_add_include_path (include_path1, TAO_ROOT, 0); @@ -297,7 +299,7 @@ DRV_cpp_init (void) } } - idl_global->tao_root (include_path1.c_str ()); + idl_global->tao_root (include_path1.c_str ()); } // Add any flags in platform_cpp_args to cpp's DRV_arglist. @@ -486,6 +488,8 @@ DRV_cpp_post_init (void) ACE_CString include_path3, include_path4, include_path5; + // When adding new dirs here don't forget to update + // IDL_GlobalData::validate_orb_include accordingly. if (TAO_ROOT != 0) { DRV_add_include_path (include_path3, TAO_ROOT, "/orbsvcs"); diff --git a/TAO/TAO_IDL/fe/fe_declarator.cpp b/TAO/TAO_IDL/fe/fe_declarator.cpp index e468dccd100..10b6bbf2b2d 100644 --- a/TAO/TAO_IDL/fe/fe_declarator.cpp +++ b/TAO/TAO_IDL/fe/fe_declarator.cpp @@ -90,11 +90,22 @@ FE_Declarator::FE_Declarator (UTL_ScopedName *n, AST_Type * FE_Declarator::compose (AST_Decl *d) { - AST_Decl::NodeType nt = d->node_type (); + AST_Type *ct = AST_Type::narrow_from_decl (d); + + if (ct == 0) + { + idl_global->err ()->not_a_type (d); + return 0; + } - if (nt == AST_Decl::NT_struct_fwd || nt == AST_Decl::NT_union_fwd) + AST_Decl::NodeType nt = d->node_type (); + + if (nt == AST_Decl::NT_struct_fwd + || nt == AST_Decl::NT_union_fwd + || nt == AST_Decl::NT_struct + || nt == AST_Decl::NT_union) { - if (! AST_Type::narrow_from_decl (d)->is_defined ()) + if (! ct->is_defined ()) { idl_global->err ()->error1 (UTL_Error::EIDL_ILLEGAL_ADD, d); @@ -103,16 +114,7 @@ FE_Declarator::compose (AST_Decl *d) } } - AST_Array *arr = 0; - AST_Type *ct = 0; - - ct = AST_Type::narrow_from_decl (d); - - if (ct == 0) - { - idl_global->err ()->not_a_type (d); - return 0; - } + AST_Array *arr = 0; // All uses of forward declared types must // not have a different prefix from the place of declaration. diff --git a/TAO/TAO_IDL/fe/fe_init.cpp b/TAO/TAO_IDL/fe/fe_init.cpp index d94c7f97d15..23caa1efd4b 100644 --- a/TAO/TAO_IDL/fe/fe_init.cpp +++ b/TAO/TAO_IDL/fe/fe_init.cpp @@ -692,6 +692,8 @@ FE_populate (void) void FE_store_env_include_paths (void) { + // If this method have to change then don't forget to update + // util/utl_global.cpp:IDL_GlobalData::validate_orb_include (...). ACE_Env_Value<char*> incl_paths ("INCLUDE", (char *) 0); const char *aggr_str = incl_paths; diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index 07fe0398257..c3232879c02 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -737,7 +737,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) { this->pd_supports_concrete = iface; - if (this->check_concrete_supported_inheritance (iface) != 0) + if (!this->check_concrete_supported_inheritance (iface)) { idl_global->err ()->concrete_supported_inheritance_error ( this->name (), @@ -759,6 +759,11 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) bool FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) { + if (this->pd_n_inherits == 0) + { + return true; + } + AST_ValueType *vt = 0; AST_Interface *concrete = 0; AST_Interface *ancestor = 0; @@ -770,12 +775,12 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) if (0 == concrete) { - return 0; + return true; } if (d == concrete) { - return 0; + return true; } for (long j = 0; j < d->n_inherits_flat (); ++j) @@ -784,12 +789,12 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) if (ancestor == concrete) { - return 0; + return true; } } } - return 1; + return false; } //************************************************************************ diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index c80415e5752..a300eddf740 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -621,6 +621,9 @@ public: static char* translateName(const char* name, char *name_buf); #endif + bool validate_orb_include (UTL_String *); + // Check if included file is in TAO specific include dirs. + private: // Data UTL_ScopeStack pd_scopes; // Store scopes stack diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index b4ebc4c1668..ae4da67cc87 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -81,6 +81,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ace/OS_NS_strings.h" #include "ace/Process.h" #include "ace/OS_NS_ctype.h" +#include "ace/Env_Value_T.h" ACE_RCSID (util, utl_global, @@ -1859,3 +1860,104 @@ IDL_GlobalData::open_included_file (char const * filename, return f; } + +bool +IDL_GlobalData::validate_orb_include (UTL_String *idl_file_name) +{ + // It's important to update the check of include_counter + // at the end of this method once new TAO include dirs are + // added somewhere in driver/drv_preproc.cpp + + // Count number of includes in environment variable. + // If the way how INCLUDE environment variable is processed + // will change in fe/fe_init.cpp:FE_store_env_include_paths () + // then the below do/while loop has to be changed accordingly. + int env_includes = 1; + ACE_Env_Value<char*> incl_paths ("INCLUDE", + (char *) 0); + const char *aggr_str = incl_paths; + if (aggr_str != 0) + { + char separator; +#if defined (ACE_WIN32) + separator = ';'; +#else + separator = ':'; +#endif + do + { + aggr_str = ACE_OS::strchr (aggr_str, separator); + env_includes++; + } while (aggr_str != 0 && aggr_str++); + } + + char abspath[MAXPATHLEN] = ""; + char *full_path = 0; + unsigned int include_counter = 0; + + for (ACE_Unbounded_Queue_Iterator<char *>iter ( + this->include_paths_ + ); + !iter.done (); ) + { + ACE_CString partial; + if (include_counter == 0) + { + char *path_tmp = ACE_OS::getcwd (abspath, MAXPATHLEN); + partial = path_tmp; + } + else + { + char **path_tmp = 0; + iter.next (path_tmp); + iter.advance (); + partial = *path_tmp; + } + + // If the include path has literal "s (because of an include + // of a Windows path with spaces), we must remove them here. + const char *tmp_partial = partial.c_str (); + if (tmp_partial && this->hasspace (tmp_partial) && tmp_partial[0] == '\"') + { + partial = + partial.substr (1, partial.length () - 2); + } + + partial += ACE_DIRECTORY_SEPARATOR_STR; + partial += idl_file_name->get_string (); + full_path = + ACE_OS::realpath (partial.c_str (), abspath); + + if (full_path != 0) + { + FILE *test = ACE_OS::fopen (abspath, "r"); + + if (test == 0) + { + ++include_counter; + continue; + } + + ACE_OS::fclose (test); + + // This file name is an orb file if it is either in first 2 + // dirs (i.e. $TAO_ROOT, $TAO_ROOT/tao) or in + // last 3 dirs (i.e. $TAO_ROOT/orbsvcs, $TAO_ROOT/CIAO, + // $TAO_ROOT/CIAO/ciao) + if (include_counter != 0 && + (include_counter - env_includes <= 2 || + include_counter - env_includes >= this->include_paths_.size () - 3)) + { + return true; + } + else + { + return false; + } + } + + ++include_counter; + } + + return false; +} diff --git a/TAO/VERSION b/TAO/VERSION index 8b208b1efda..0fe653c4274 100644 --- a/TAO/VERSION +++ b/TAO/VERSION @@ -1,4 +1,4 @@ -This is TAO version 1.6.1, released Wed Sep 19 04:10:15 CDT 2007 +This is TAO version 1.6.2, released Fri Dec 14 02:48:57 CST 2007 If you have any problems with or questions about TAO, please send e-mail to the TAO mailing list (tao-users@cs.wustl.edu), using the diff --git a/TAO/docs/rtcorba/features.html b/TAO/docs/rtcorba/features.html index d360ee31c2d..65639d82577 100644 --- a/TAO/docs/rtcorba/features.html +++ b/TAO/docs/rtcorba/features.html @@ -212,7 +212,8 @@ When using the <code>RTORBDynamicThreadIdleTimeout</code> from the <code>RT_ORB_Loader</code> it can be specified that the dynamic threads should end after a given idle time. Timeout must be specified in microseconds, 0 means the threads -will stay alive forever. +will stay alive forever. With <code>RTORBDynamicThreadRunTime</code> you +specify the amount of time after a dynamic thread ends itself. </ul> <h3> diff --git a/TAO/docs/tutorials/Quoter/RTCORBA/Distributor_i.h b/TAO/docs/tutorials/Quoter/RTCORBA/Distributor_i.h index e7ecf716956..888727905b6 100644 --- a/TAO/docs/tutorials/Quoter/RTCORBA/Distributor_i.h +++ b/TAO/docs/tutorials/Quoter/RTCORBA/Distributor_i.h @@ -199,7 +199,7 @@ private: // Define typedefs for our version of the stock database. -typedef ACE_Singleton<Stock_Database<StockDistributor_i>, ACE_Thread_Mutex> Stock_Database_Singleton; +typedef ACE_Singleton<Stock_Database<StockDistributor_i>, TAO_SYNCH_MUTEX> Stock_Database_Singleton; #define STOCK_DATABASE Stock_Database_Singleton::instance() #endif /* DISTRIBUTORI_H_ */ diff --git a/TAO/docs/tutorials/Quoter/RTCORBA/Stock_Database.h b/TAO/docs/tutorials/Quoter/RTCORBA/Stock_Database.h index 8e3e874fe6f..1b9aaa75273 100644 --- a/TAO/docs/tutorials/Quoter/RTCORBA/Stock_Database.h +++ b/TAO/docs/tutorials/Quoter/RTCORBA/Stock_Database.h @@ -13,6 +13,9 @@ // ACE headers #include "ace/Task.h" +// TAO headrs +// #include "tao/orbconf.h" + // STL headers #include <map> #include <string> @@ -132,7 +135,7 @@ private: #include "Stock_Database.tpp" -//typedef ACE_Singleton<Stock_Database, ACE_Thread_Mutex> Stock_Database_Singleton; +//typedef ACE_Singleton<Stock_Database, TAO_SYNCH_MUTEX> Stock_Database_Singleton; //#define STOCK_DATABASE Stock_Database_Singleton::instance() #endif // !defined STOCK_DATABASE_H_ diff --git a/TAO/examples/AMI/FL_Callback/FL_Callback.mpc b/TAO/examples/AMI/FL_Callback/FL_Callback.mpc index afa8cea434f..b92be693ead 100644 --- a/TAO/examples/AMI/FL_Callback/FL_Callback.mpc +++ b/TAO/examples/AMI/FL_Callback/FL_Callback.mpc @@ -5,6 +5,7 @@ project(*idl): taoexe, messaging, ami { IDL_Files { test.idl } + custom_only = 1 } @@ -18,6 +19,18 @@ project(*progress): taoexe, messaging, ami, portableserver, tao_flresource { testS.cpp testC.cpp } + + Header_Files { + Progress_i.h + testC.h + testS.h + } + + Inline_Files { + testC.inl + testS.inl + } + IDL_Files { } } @@ -32,6 +45,18 @@ project(*peer): taoexe, strategies, messaging, ami, portableserver { testS.cpp testC.cpp } + + Header_Files { + Peer_i.h + testC.h + testS.h + } + + Inline_Files { + testC.inl + testS.inl + } + IDL_Files { } } diff --git a/TAO/examples/CSD_Strategy/ThreadPool/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/CSD_Strategy/ThreadPool2/FooServantList.h b/TAO/examples/CSD_Strategy/ThreadPool2/FooServantList.h index c07350e07b4..3fd17c54093 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool2/FooServantList.h +++ b/TAO/examples/CSD_Strategy/ThreadPool2/FooServantList.h @@ -25,7 +25,7 @@ class FooServantList private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; PortableServer::ServantBase_var* servants_; diff --git a/TAO/examples/CSD_Strategy/ThreadPool2/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool2/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool2/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool2/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/CSD_Strategy/ThreadPool3/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool3/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool3/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool3/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/CSD_Strategy/ThreadPool4/Foo_i.cpp b/TAO/examples/CSD_Strategy/ThreadPool4/Foo_i.cpp index 56d95507f92..5f1027a568d 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool4/Foo_i.cpp +++ b/TAO/examples/CSD_Strategy/ThreadPool4/Foo_i.cpp @@ -227,7 +227,7 @@ Foo_i::test_callback ( void Foo_i::done(void) { - static ACE_Atomic_Op <ACE_SYNCH_MUTEX, unsigned> num_clients = 2; + static ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned> num_clients = 2; num_clients --; diff --git a/TAO/examples/CSD_Strategy/ThreadPool4/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool4/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool4/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool4/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h b/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h index 8a3f6dd3c3f..d0ae86d7373 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h +++ b/TAO/examples/CSD_Strategy/ThreadPool5/FooServantList.h @@ -33,7 +33,7 @@ class FooServantList private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; Foo_i** servants_; diff --git a/TAO/examples/CSD_Strategy/ThreadPool5/Foo_i.h b/TAO/examples/CSD_Strategy/ThreadPool5/Foo_i.h index 5173fa40f6e..ab3ad761965 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool5/Foo_i.h +++ b/TAO/examples/CSD_Strategy/ThreadPool5/Foo_i.h @@ -86,9 +86,9 @@ class Foo_i : public virtual POA_Foo private: - typedef ACE_Atomic_Op <ACE_SYNCH_MUTEX, CORBA::Long> AtomicLong; - typedef ACE_Atomic_Op <ACE_SYNCH_MUTEX, unsigned> AtomicUnsigned; - typedef ACE_Atomic_Op <ACE_SYNCH_MUTEX, bool> AtomicBool; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Long> AtomicLong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned> AtomicUnsigned; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, bool> AtomicBool; AtomicLong value_; AtomicUnsigned count_op1_; diff --git a/TAO/examples/CSD_Strategy/ThreadPool5/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool5/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool5/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool5/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/CSD_Strategy/ThreadPool6/OrbShutdownTask.h b/TAO/examples/CSD_Strategy/ThreadPool6/OrbShutdownTask.h index 3795d12c3c9..b7e4bca8d74 100644 --- a/TAO/examples/CSD_Strategy/ThreadPool6/OrbShutdownTask.h +++ b/TAO/examples/CSD_Strategy/ThreadPool6/OrbShutdownTask.h @@ -36,6 +36,6 @@ class OrbShutdownTask : public ACE_Task_Base CORBA::ORB_var orb_; }; -typedef ACE_Singleton<OrbShutdownTask, ACE_Thread_Mutex> TheOrbShutdownTask; +typedef ACE_Singleton<OrbShutdownTask, TAO_SYNCH_MUTEX> TheOrbShutdownTask; #endif diff --git a/TAO/examples/RTCORBA/Activity/Activity.cpp b/TAO/examples/RTCORBA/Activity/Activity.cpp index 41097945640..743471849b1 100644 --- a/TAO/examples/RTCORBA/Activity/Activity.cpp +++ b/TAO/examples/RTCORBA/Activity/Activity.cpp @@ -117,8 +117,6 @@ Activity::resolve_naming_service (void) this->naming_ = CosNaming::NamingContextExt::_narrow (naming_obj.in ()); - //@@tmp hack, otherwise crashes on exit!..?? - CosNaming::NamingContextExt::_duplicate (this->naming_.in()); return 0; } @@ -337,9 +335,14 @@ Activity::run (int argc, char *argv[]) orb_->run (); - orb_->destroy (); - ACE_Thread_Manager::instance ()->wait (); + + CORBA::release (this->naming_); + + // Hack for proper cleanup. + this->builder_->fini (); + + orb_->destroy (); } void diff --git a/TAO/examples/RTCORBA/Activity/Activity.h b/TAO/examples/RTCORBA/Activity/Activity.h index ed3d66a2f32..d213444fa22 100644 --- a/TAO/examples/RTCORBA/Activity/Activity.h +++ b/TAO/examples/RTCORBA/Activity/Activity.h @@ -72,7 +72,7 @@ public: /// Job shutdown notification void job_ended (Job_i* ended_job); - protected: +protected: /// = Activation methods. /// Activate the POA's void activate_poa_list (void); @@ -114,7 +114,7 @@ public: PortableServer::POA_var root_poa_; /// A naming context. - CosNaming::NamingContextExt_var naming_; + CosNaming::NamingContextExt_ptr naming_; /// The Priority Mapping helper. RTCORBA::PriorityMapping *priority_mapping_; diff --git a/TAO/examples/RTCORBA/Activity/Builder.cpp b/TAO/examples/RTCORBA/Activity/Builder.cpp index 5075c7cd5ad..96214defcca 100644 --- a/TAO/examples/RTCORBA/Activity/Builder.cpp +++ b/TAO/examples/RTCORBA/Activity/Builder.cpp @@ -20,9 +20,6 @@ Builder::Builder(void) Builder::~Builder(void) { - delete[] this->poa_list_; - delete[] this->task_list_; - delete[] this->job_list_; } int @@ -42,61 +39,85 @@ Builder::init (int argc, char *argv[]) { task_count_ = ACE_OS::atoi (current_arg); ACE_NEW_RETURN (task_list_, Periodic_Task*[task_count_], -1); + ACE_OS::memset (this->task_list_, + this->task_count_ * sizeof (this->task_list_[0]), + 0); arg_shifter.consume_arg (); } if (0 != (current_arg = arg_shifter.get_the_parameter ("-JobCount"))) { job_count_ = ACE_OS::atoi (current_arg); ACE_NEW_RETURN (job_list_, Job_i*[job_count_], -1); + ACE_OS::memset (this->job_list_, + this->job_count_ * sizeof (this->job_list_[0]), + 0); arg_shifter.consume_arg (); } if (0 != (current_arg = arg_shifter.get_the_parameter ("-POACount"))) { poa_count_ = ACE_OS::atoi (current_arg); ACE_NEW_RETURN (poa_list_, POA_Holder*[poa_count_], -1); + ACE_OS::memset (this->poa_list_, + this->poa_count_ * sizeof (this->poa_list_[0]), + 0); arg_shifter.consume_arg (); } else if (arg_shifter.cur_arg_strncasecmp ("-ThreadTask") == 0) { - arg_shifter.consume_arg (); + if (task_count < this->task_count_) + { + arg_shifter.consume_arg (); - Periodic_Task *task = 0; + Periodic_Task *task; - ACE_NEW_RETURN (task, Thread_Task (), -1); + ACE_NEW_RETURN (task, Thread_Task (), -1); - if (task->init_task (arg_shifter) == -1) - return -1; + if (task->init_task (arg_shifter) == -1) + return -1; - task_list_[task_count++] = task; + task_list_[task_count++] = task; + } + else + return -1; } else if (arg_shifter.cur_arg_strncasecmp ("-Job") == 0) { - arg_shifter.consume_arg (); + if (job_count < this->job_count_) + { + arg_shifter.consume_arg (); - Job_i *job = 0; + Job_i *job; - ACE_NEW_RETURN (job, Job_i (), -1); + ACE_NEW_RETURN (job, Job_i (), -1); - if (job->init (arg_shifter) == -1) - return -1; + if (job->init (arg_shifter) == -1) + return -1; - this->job_list_[job_count++] = job; + this->job_list_[job_count++] = job; + } + else + return -1; } else if (arg_shifter.cur_arg_strncasecmp ("-POA") == 0) { - arg_shifter.consume_arg (); + if (poa_count < this->poa_count_) + { + arg_shifter.consume_arg (); - POA_Holder *poa_holder; + POA_Holder *poa_holder; - ACE_NEW_RETURN (poa_holder, POA_Holder (), -1); + ACE_NEW_RETURN (poa_holder, POA_Holder (), -1); - if (poa_holder->init (arg_shifter) == -1) - { - delete poa_holder; - return -1; - } + if (poa_holder->init (arg_shifter) == -1) + { + delete poa_holder; + return -1; + } - this->poa_list_[poa_count++] = poa_holder; + this->poa_list_[poa_count++] = poa_holder; + } + else + return -1; } else { @@ -110,6 +131,25 @@ Builder::init (int argc, char *argv[]) int Builder::fini (void) { + // It's only a hack for proper cleanup of this badly designed test. + static bool already_cleaned = false; + if (already_cleaned) + return 0; + + int count; + + for (count = 0; count < this->task_count_; ++count) + delete this->task_list_[count]; + delete [] this->task_list_; + + delete [] this->job_list_; + + for (count = 0; count < this->poa_count_; ++count) + delete this->poa_list_[count]; + delete [] this->poa_list_; + + already_cleaned = true; + return 0; } diff --git a/TAO/examples/RTCORBA/Activity/Job.idl b/TAO/examples/RTCORBA/Activity/Job.idl index 67c6efa531b..f5117788b04 100644 --- a/TAO/examples/RTCORBA/Activity/Job.idl +++ b/TAO/examples/RTCORBA/Activity/Job.idl @@ -6,5 +6,5 @@ interface Job { void work (in unsigned long work); - oneway void shutdown (); + oneway void shutdown (); }; diff --git a/TAO/examples/RTCORBA/Activity/POA_Holder.cpp b/TAO/examples/RTCORBA/Activity/POA_Holder.cpp index 9383f075547..d58f7673480 100644 --- a/TAO/examples/RTCORBA/Activity/POA_Holder.cpp +++ b/TAO/examples/RTCORBA/Activity/POA_Holder.cpp @@ -4,10 +4,10 @@ #include "ace/Log_Msg.h" POA_Holder::POA_Holder (void) - :priority_model_ (RTCORBA::CLIENT_PROPAGATED), - server_priority_ (0) - { - } + : priority_model_ (RTCORBA::CLIENT_PROPAGATED), + server_priority_ (0) +{ +} int POA_Holder::init (ACE_Arg_Shifter& arg_shifter) @@ -58,7 +58,9 @@ POA_Holder::init (ACE_Arg_Shifter& arg_shifter) //if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "lane parsed - %d, %d, %d\n", - lanes_[l_index].lane_priority, lanes_[l_index].static_threads, lanes_[l_index].dynamic_threads)); + lanes_[l_index].lane_priority, + lanes_[l_index].static_threads, + lanes_[l_index].dynamic_threads)); l_index++; } else @@ -88,7 +90,7 @@ POA_Holder::init (ACE_Arg_Shifter& arg_shifter) arg_shifter.consume_arg (); //if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "band parsed - %d, %d \n", + ACE_DEBUG ((LM_DEBUG, "band parsed - %d, %d\n", bands_[b_index].low, bands_[b_index].high)); b_index++; } @@ -123,7 +125,7 @@ POA_Holder::activate (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_ else policy_list_length = 1 - */ + */ CORBA::Policy_var priority_model_policy; CORBA::Policy_var lanes_policy; @@ -202,7 +204,7 @@ POA_Holder::activate (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_ PortableServer::POAManager_var poa_manager = parent_poa->the_POAManager (); - parent_poa->create_POA (POA_name_.c_str (), - poa_manager.in (), - poa_policy_list); + this->poa_ = parent_poa->create_POA (POA_name_.c_str (), + poa_manager.in (), + poa_policy_list); } diff --git a/TAO/examples/RTCORBA/Activity/POA_Holder.h b/TAO/examples/RTCORBA/Activity/POA_Holder.h index 4f5328ed71f..504abe8c31e 100644 --- a/TAO/examples/RTCORBA/Activity/POA_Holder.h +++ b/TAO/examples/RTCORBA/Activity/POA_Holder.h @@ -38,6 +38,9 @@ class activity_Export POA_Holder void activate (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_poa); protected: + /// Cleanup. + PortableServer::POA_var poa_; + /// = POA create options. ACE_CString POA_name_; RTCORBA::PriorityModel priority_model_; diff --git a/TAO/examples/RTCORBA/Activity/Task_Stats.cpp b/TAO/examples/RTCORBA/Activity/Task_Stats.cpp index bcd6ae53d88..2ba5ed8938a 100644 --- a/TAO/examples/RTCORBA/Activity/Task_Stats.cpp +++ b/TAO/examples/RTCORBA/Activity/Task_Stats.cpp @@ -181,5 +181,5 @@ Task_Stats::dump_latency_stats (ACE_TCHAR *out_msg, ACE_UINT32 sf) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<Base_Time, ACE_Thread_Mutex> *ACE_Singleton<Base_Time, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<Base_Time, TAO_SYNCH_MUTEX> *ACE_Singleton<Base_Time, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/examples/RTCORBA/Activity/run_test.pl b/TAO/examples/RTCORBA/Activity/run_test.pl index aeeb44be5d5..f98f1d20a44 100755 --- a/TAO/examples/RTCORBA/Activity/run_test.pl +++ b/TAO/examples/RTCORBA/Activity/run_test.pl @@ -62,7 +62,7 @@ if ($status != 0) print STDERR "ERROR: Client Activity returned $status\n"; } -$Activity_Server->Kill (); +$Activity_Server->WaitKill (10); $Naming->Kill (); exit $status; diff --git a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp index ae213924f3f..a514cd4625e 100644 --- a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp +++ b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp @@ -244,5 +244,5 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<DT_Test, ACE_Thread_Mutex> *ACE_Singleton<DT_Test, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<DT_Test, TAO_SYNCH_MUTEX> *ACE_Singleton<DT_Test, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp b/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp index 9be11e627f8..e223db89175 100644 --- a/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp +++ b/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp @@ -152,5 +152,5 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<DT_Test, ACE_Thread_Mutex> *ACE_Singleton<DT_Test, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<DT_Test, TAO_SYNCH_MUTEX> *ACE_Singleton<DT_Test, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/examples/RTScheduling/Task_Stats.cpp b/TAO/examples/RTScheduling/Task_Stats.cpp index 15ad134b4a7..fbbc2e1909c 100644 --- a/TAO/examples/RTScheduling/Task_Stats.cpp +++ b/TAO/examples/RTScheduling/Task_Stats.cpp @@ -99,5 +99,5 @@ Task_Stats::dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg, } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<Task_Stats, ACE_Thread_Mutex> *ACE_Singleton<Task_Stats, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<Task_Stats, TAO_SYNCH_MUTEX> *ACE_Singleton<Task_Stats, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/examples/RTScheduling/Task_Stats.inl b/TAO/examples/RTScheduling/Task_Stats.inl index 3b50f8c52a4..0971502bcc0 100644 --- a/TAO/examples/RTScheduling/Task_Stats.inl +++ b/TAO/examples/RTScheduling/Task_Stats.inl @@ -1,5 +1,7 @@ //$Id$ +#include "ace/Log_Msg.h" + ACE_INLINE int Task_Stats::sample (ACE_UINT32 thr_run_time, int thr_count) { diff --git a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h index 289fc1ae775..8fc5a11b2bf 100644 --- a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h +++ b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h @@ -207,8 +207,8 @@ namespace TAO * Implementation methods should assume the mutex is * locked if necessary. */ - ACE_SYNCH_MUTEX internals_; - typedef ACE_Guard<ACE_SYNCH_MUTEX> InternalGuard; + TAO_SYNCH_MUTEX internals_; + typedef ACE_Guard<TAO_SYNCH_MUTEX> InternalGuard; /** * The orb diff --git a/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h index cfffe13aec6..fad9523fb34 100644 --- a/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h +++ b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h @@ -149,8 +149,8 @@ namespace TAO * Implementation methods should assume the mutex is * locked if necessary. */ - ACE_SYNCH_MUTEX internals_; - typedef ACE_Guard<ACE_SYNCH_MUTEX> InternalGuard; + TAO_SYNCH_MUTEX internals_; + typedef ACE_Guard<TAO_SYNCH_MUTEX> InternalGuard; /** * The orb diff --git a/TAO/orbsvcs/IFR_Service/IFR_Server.cpp b/TAO/orbsvcs/IFR_Service/IFR_Server.cpp index 905212046e3..99f6128eb74 100644 --- a/TAO/orbsvcs/IFR_Service/IFR_Server.cpp +++ b/TAO/orbsvcs/IFR_Service/IFR_Server.cpp @@ -3,16 +3,44 @@ #include "IFR_Service.h" #include "tao/Environment.h" +#include "orbsvcs/Shutdown_Utilities.h" ACE_RCSID (IFR_Service, IFR_Server, "$Id$") +class IFR_Service_Shutdown_Functor : public Shutdown_Functor +{ +public: + IFR_Service_Shutdown_Functor (IFR_Service& ifr); + + void operator() (int which_signal); +private: + IFR_Service& ifr_; +}; + +IFR_Service_Shutdown_Functor::IFR_Service_Shutdown_Functor (IFR_Service &ifr) + : ifr_(ifr) +{ +} + +void +IFR_Service_Shutdown_Functor::operator() (int which_signal) +{ + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "shutting down on signal %d\n", which_signal)); + (void) this->ifr_.shutdown (); +} + int main (int argc, char *argv[]) { IFR_Service server; + IFR_Service_Shutdown_Functor killer (server); + Service_Shutdown kill_contractor (killer); + try { int status = server.init (argc, argv); diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.cpp b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp index 95fdd4a1291..23f3d0f39db 100644 --- a/TAO/orbsvcs/IFR_Service/IFR_Service.cpp +++ b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp @@ -75,3 +75,8 @@ IFR_Service::fini (void) return 0; } +void +IFR_Service::shutdown (void) +{ + this->orb_->shutdown (); +} diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.h b/TAO/orbsvcs/IFR_Service/IFR_Service.h index 034d00696d8..993c1575559 100644 --- a/TAO/orbsvcs/IFR_Service/IFR_Service.h +++ b/TAO/orbsvcs/IFR_Service/IFR_Service.h @@ -50,6 +50,9 @@ public: /// Run the IFR service. int run (void); + /// Shutdown the Service. + void shutdown (void); + protected: /// Reference to our ORB. diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp index c173edf6663..d1cb1f29540 100644 --- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp +++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp @@ -2022,31 +2022,45 @@ ifr_adding_visitor::visit_constant (AST_Constant *node) } } - AST_Expression::AST_ExprValue *ev = node->constant_value ()->ev (); - AST_Decl *td = node->constant_value ()->get_tdef (); - - if (td != 0 && td->node_type () == AST_Decl::NT_typedef) - { - // This constant's type is a typedef - look up the typedef to - // pass to create_constant(). + AST_Expression::ExprType et = node->et (); + AST_Expression *cv = node->constant_value (); + + /// @@@ (JP 2007-12-12) I've removed code to check + /// for constants of typedefs. The CORBA document + /// formal/2004-03-12 (CORBA 3.0.3) says in section + /// 10.5.8.1 that the type of a constant in the IFR must be + /// 'one of the primitive types allowed in constant + /// declarations'. So for constants of typedefs we store + /// the underlying type in the IFR. + + if (et == AST_Expression::EV_enum) + { + // This constant's type is an enum - look up the enum member + // representing the value, then get the enclosing enum to pass + // to create_constant(). + AST_Decl *enum_val = + node->defined_in ()->lookup_by_name (cv->n (), true); + AST_Decl *d = ScopeAsDecl (enum_val->defined_in ()); + CORBA::Contained_var contained = - be_global->repository ()->lookup_id (td->repoID ()); - + be_global->repository ()->lookup_id (d->repoID ()); + this->ir_current_ = CORBA::IDLType::_narrow (contained.in ()); } else { - CORBA::PrimitiveKind pkind = this->expr_type_to_pkind (ev->et); + // This constant's type is a primitive type - fetch it from the + // repo and pass it to create_constant(). + CORBA::PrimitiveKind pkind = this->expr_type_to_pkind (et); + this->ir_current_ = be_global->repository ()->get_primitive (pkind); } CORBA::Any any; - this->load_any (ev, - any); + this->load_any (cv->ev (), any); - CORBA::Container_ptr current_scope = - CORBA::Container::_nil (); + CORBA::Container_ptr current_scope = CORBA::Container::_nil (); if (be_global->ifr_scopes ().top (current_scope) == 0) { @@ -2492,6 +2506,9 @@ ifr_adding_visitor::load_any (AST_Expression::AST_ExprValue *ev, delete wstr; break; } + case AST_Expression::EV_enum: + any <<= static_cast<CORBA::ULong> (ev->u.eval); + break; default: break; } diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp index 858a1658ca0..d2f0857d41e 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp @@ -459,7 +459,8 @@ ImR_Locator_i::activate_server (const char* server) // This is the version called by tao_imr to activate the server, manually // starting it if necessary. - activate_server_by_name (server, true); + CORBA::String_var cleanup = + activate_server_by_name (server, true); } char* @@ -1217,7 +1218,8 @@ ImR_Locator_i::auto_start_servers (void) if (info->activation_mode == ImplementationRepository::AUTO_START && info->cmdline.length () > 0) { - this->activate_server_i (*info, true); + CORBA::String_var cleanup = + this->activate_server_i (*info, true); } } catch (const CORBA::Exception& ex) diff --git a/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp index bfa9e0956a7..24fda5bcdea 100644 --- a/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp +++ b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp @@ -58,7 +58,8 @@ TAO_LB_Signal_Handler::activate (long flags, ACE_hthread_t thread_handles[], void *stack[], size_t stack_size[], - ACE_thread_t thread_ids[]) + ACE_thread_t thread_ids[], + const char* thr_name[]) { // sigwait() is not implemented on MS Windows. Handle signals // asynchronously through the ORB's reactor in that case instead. @@ -74,7 +75,8 @@ TAO_LB_Signal_Handler::activate (long flags, thread_handles, stack, stack_size, - thread_ids); + thread_ids, + thr_name); #else ACE_UNUSED_ARG (flags); ACE_UNUSED_ARG (n_threads); @@ -86,6 +88,7 @@ TAO_LB_Signal_Handler::activate (long flags, ACE_UNUSED_ARG (stack); ACE_UNUSED_ARG (stack_size); ACE_UNUSED_ARG (thread_ids); + ACE_UNUSED_ARG (thr_name); return this->orb_->orb_core ()->reactor ()->register_handler (this->sigset_, diff --git a/TAO/orbsvcs/LoadBalancer/Signal_Handler.h b/TAO/orbsvcs/LoadBalancer/Signal_Handler.h index 5e9e7c2dea2..c4d8710b86c 100644 --- a/TAO/orbsvcs/LoadBalancer/Signal_Handler.h +++ b/TAO/orbsvcs/LoadBalancer/Signal_Handler.h @@ -66,7 +66,8 @@ public: ACE_hthread_t thread_handles[] = 0, void *stack[] = 0, size_t stack_size[] = 0, - ACE_thread_t thread_ids[] = 0); + ACE_thread_t thread_ids[] = 0, + const char* thr_name[] = 0); /// Called when object is signaled by OS (either via UNIX signals or /// when a Win32 object becomes signaled). diff --git a/TAO/orbsvcs/Mobility_Service/GTP.idl b/TAO/orbsvcs/Mobility_Service/GTP.idl deleted file mode 100644 index 4f592550a5f..00000000000 --- a/TAO/orbsvcs/Mobility_Service/GTP.idl +++ /dev/null @@ -1,2 +0,0 @@ -// $Id$ -//Hello diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp index 97f815e5931..77839d3aa5a 100644 --- a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp +++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp @@ -161,8 +161,7 @@ TAO_NT_Naming_Service::svc (void) { TAO_Naming_Service naming_service; - if (naming_service.init (argc_, - argv_) == -1) + if (naming_service.init (argc_, argv_) == -1) return -1; try diff --git a/TAO/orbsvcs/PSS/PSDL_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Scope.cpp index 13829c524af..e00f61e8f0b 100644 --- a/TAO/orbsvcs/PSS/PSDL_Scope.cpp +++ b/TAO/orbsvcs/PSS/PSDL_Scope.cpp @@ -924,5 +924,5 @@ TAO_PSDL_Scope::scope_map (void) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template TAO_Singleton<TAO_PSDL_Scope, ACE_Thread_Mutex> *TAO_Singleton<TAO_PSDL_Scope, ACE_Thread_Mutex>::singleton_; +template TAO_Singleton<TAO_PSDL_Scope, TAO_SYNCH_MUTEX> *TAO_Singleton<TAO_PSDL_Scope, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp index 834a34cb8bd..fef78a9b20a 100644 --- a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp +++ b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp @@ -53,7 +53,7 @@ RPS_Monitor::loads (void) ACE_Time_Value elapsed_time; { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, this->lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, monitor, this->lock_, 0); elapsed_time = current_time - this->last_time_; this->last_time_ = current_time; diff --git a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h index 2c81309da6e..ecb6dd500a4 100644 --- a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h +++ b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h @@ -81,7 +81,7 @@ private: ACE_Time_Value last_time_; - ACE_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX lock_; }; #include /**/ "ace/post.h" diff --git a/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h index 80f1b2ab4ba..74cb2fd2228 100644 --- a/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h +++ b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h @@ -95,7 +95,7 @@ protected: private: /// The number of requests that have arrived on the server. - ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> request_count_; + ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> request_count_; }; diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h index ff05025cf66..891bb16d0f9 100644 --- a/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h +++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h @@ -75,7 +75,7 @@ private: ACE_RMCast::Socket socket_; CORBA::String_var id_; - typedef ACE_SYNCH_MUTEX Mutex; + typedef TAO_SYNCH_MUTEX Mutex; typedef ACE_Guard<Mutex> Lock; bool stop_; diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.cpp b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp index dd2a7a90261..b909407b0ec 100644 --- a/TAO/orbsvcs/orbsvcs/AV/UDP.cpp +++ b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp @@ -801,7 +801,7 @@ TAO_AV_UDP_Connection_Setup::setup (TAO_AV_Flow_Handler *&flow_handler, flow_handler = handler; - result = handler->get_mcast_socket ()->subscribe (*inet_addr); + result = handler->get_mcast_socket ()->join (*inet_addr); if (result < 0) ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_UDP_MCast_connector::open failed\n"),-1); @@ -840,15 +840,15 @@ TAO_AV_UDP_Connection_Setup::setup (TAO_AV_Flow_Handler *&flow_handler, local_addr->set (local_addr->get_port_number (), local_addr->get_host_name ()); - handler->set_peer_addr (local_addr); + handler->set_peer_addr (local_addr); } } else { if (local_addr == 0) - ACE_NEW_RETURN (local_addr, - ACE_INET_Addr ("0"), - -1); + ACE_NEW_RETURN (local_addr, + ACE_INET_Addr ("0"), + -1); TAO_AV_UDP_Flow_Handler *handler; ACE_NEW_RETURN (handler, @@ -860,7 +860,7 @@ TAO_AV_UDP_Connection_Setup::setup (TAO_AV_Flow_Handler *&flow_handler, if (ct == ACCEPTOR) result = handler->open (*inet_addr); else - result = handler->open (*local_addr); + result = handler->open (*local_addr); if (result < 0) ACE_ERROR_RETURN ((LM_ERROR,"handler::open failed\n"),-1); @@ -882,7 +882,7 @@ TAO_AV_UDP_Connection_Setup::setup (TAO_AV_Flow_Handler *&flow_handler, return 0; if (ct == CONNECTOR) - handler->set_remote_address (inet_addr); + handler->set_remote_address (inet_addr); result = handler->get_socket ()->get_local_addr (*local_addr); @@ -971,8 +971,9 @@ int TAO_AV_UDP_Object::send_frame (ACE_Message_Block *frame, TAO_AV_frame_info * /*frame_info*/) { - if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Object::send_frame\n")); - int result = this->transport_->send (frame); + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Object::send_frame\n")); + int const result = this->transport_->send (frame); if (result < 0) return result; return 0; @@ -983,7 +984,7 @@ TAO_AV_UDP_Object::send_frame (const iovec *iov, int iovcnt, TAO_AV_frame_info * /*frame_info*/) { - int result = this->transport_->send (iov,iovcnt); + int const result = this->transport_->send (iov,iovcnt); if (result < 0) return result; return 0; @@ -993,7 +994,7 @@ int TAO_AV_UDP_Object::send_frame (const char*buf, size_t len) { - int result = this->transport_->send (buf, len, 0); + int const result = this->transport_->send (buf, len, 0); if (result < 0) return result; return 0; diff --git a/TAO/orbsvcs/orbsvcs/AV/sfp.cpp b/TAO/orbsvcs/orbsvcs/AV/sfp.cpp index 2f3d578b3a4..200dbc25984 100644 --- a/TAO/orbsvcs/orbsvcs/AV/sfp.cpp +++ b/TAO/orbsvcs/orbsvcs/AV/sfp.cpp @@ -1321,7 +1321,7 @@ TAO_SFP_Frame_State::reset (void) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<TAO_SFP_Base, ACE_Thread_Mutex> *ACE_Singleton<TAO_SFP_Base, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<TAO_SFP_Base, TAO_SYNCH_MUTEX> *ACE_Singleton<TAO_SFP_Base, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp index 17c751db626..c0a29341e9a 100644 --- a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp +++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp @@ -5,8 +5,8 @@ #include "orbsvcs/ETCL/ETCL_Constraint_Visitor.h" #include "orbsvcs/ETCL/ETCL_y.h" -#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/AnyTypeCode/TypeCode.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/AnyTypeCode/Any.h" #include "tao/CDR.h" #include "tao/SystemException.h" diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp index fa40043a50f..1e101055c0f 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp @@ -37,10 +37,10 @@ TAO_ECG_Simple_Mcast_EH::open (const char * mcast_addr, mcast_addr), -1); - if (this->dgram_.subscribe (mcast_group, 1, net_if) != 0) + if (this->dgram_.join (mcast_group, 1, net_if) != 0) ACE_ERROR_RETURN ((LM_ERROR, "Unable to open mcast handler: error " - "subscribing to %s\n", + "joining to %s\n", mcast_addr), -1); diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp index 962a359017e..1137af088b0 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp @@ -41,7 +41,7 @@ TAO_EC_TPC_Dispatching::~TAO_EC_TPC_Dispatching () int TAO_EC_TPC_Dispatching::add_consumer (RtecEventComm::PushConsumer_ptr consumer) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1); // Duplicate the pointer and hold it safely RtecEventComm::PushConsumer_var pc = @@ -97,7 +97,7 @@ TAO_EC_TPC_Dispatching::add_consumer (RtecEventComm::PushConsumer_ptr consumer) int TAO_EC_TPC_Dispatching::remove_consumer (RtecEventComm::PushConsumer_ptr consumer) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1); TAO_EC_Dispatching_Task* dtask = 0; @@ -131,7 +131,7 @@ TAO_EC_TPC_Dispatching::activate (void) void TAO_EC_TPC_Dispatching::shutdown (void) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); // The MT_Dispatching strategy sends a TAO_EC_Shutdown_Task_Command // to the dispatching task. Is that what we should do here? @@ -183,7 +183,7 @@ TAO_EC_TPC_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy, if (TAO_EC_TPC_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) TPC_Dispatching::push_nocopy(supplier=%@,consumer=%@)\n", proxy, consumer)); - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); TAO_EC_Dispatching_Task* dtask; if (this->consumer_task_map_.find (consumer, dtask) == -1) diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h index b7ece85cb30..89b1cfbb81b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h @@ -88,7 +88,7 @@ private: // Lock for modifying the map. It's not enough to have a lock only // on the map, because we have to hold the map constant while doing // multiple distinct map manipulations, such as in remove_consumer(). - ACE_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX lock_; // Service object information TAO_EC_Queue_Full_Service_Object* queue_full_service_object_; // @@ who will release? diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp index 6d8c87e0ec5..bb186614eb8 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp @@ -37,7 +37,7 @@ namespace TAO // Would be nice to have runtime option. ACE_NEW (this->lock_, - ACE_Lock_Adapter<ACE_SYNCH_MUTEX>); + ACE_Lock_Adapter<TAO_SYNCH_MUTEX>); } diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h index c362d5f67c9..a841cdb2b07 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h @@ -41,7 +41,7 @@ public: void get_state(FtRtecEventChannelAdmin::CachedOptionResults& state); void set_state(const FtRtecEventChannelAdmin::CachedOptionResults& state); private: - typedef ACE_Hash_Map_Manager<ACE_CString, CachedRequestInfo, ACE_SYNCH_MUTEX> TableImpl; + typedef ACE_Hash_Map_Manager<ACE_CString, CachedRequestInfo, TAO_SYNCH_MUTEX> TableImpl; TableImpl table_; }; diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp index a1c85c10f83..259d2611f66 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp @@ -156,7 +156,7 @@ GroupInfoPublisherBase::update_info(GroupInfoPublisherBase::Info_ptr& info) } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<GroupInfoPublisherBase, ACE_Thread_Mutex> *ACE_Singleton<GroupInfoPublisherBase, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<GroupInfoPublisherBase, TAO_SYNCH_MUTEX> *ACE_Singleton<GroupInfoPublisherBase, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h index d21db5c3fa8..aac9b9dad39 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h @@ -41,7 +41,7 @@ public: }; typedef auto_ptr<Info> Info_ptr; - friend class ACE_Singleton<GroupInfoPublisherBase, ACE_SYNCH_MUTEX>; + friend class ACE_Singleton<GroupInfoPublisherBase, TAO_SYNCH_MUTEX>; void subscribe(TAO_FTEC_Become_Primary_Listener* listener); void set_naming_context(CosNaming::NamingContext_var naming_context); @@ -75,7 +75,7 @@ private: Info_ptr info_; }; -typedef ACE_Singleton<GroupInfoPublisherBase, ACE_SYNCH_MUTEX> GroupInfoPublisher; +typedef ACE_Singleton<GroupInfoPublisherBase, TAO_SYNCH_MUTEX> GroupInfoPublisher; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h index d1938c74516..9e8d3df836d 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h @@ -40,7 +40,7 @@ public: virtual void set_state_excep (::Messaging::ExceptionHolder * excep_holder); private: ACE_Auto_Event& evt_; - ACE_Atomic_Op< ACE_SYNCH_MUTEX, int > num_backups_; + ACE_Atomic_Op< TAO_SYNCH_MUTEX, int > num_backups_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp index c207baefd16..63ed805a07a 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp @@ -30,7 +30,7 @@ Update_Manager::~Update_Manager() void Update_Manager::handle_reply(int id) { - ACE_Guard<ACE_SYNCH_MUTEX> guard(mutex_); + ACE_Guard<TAO_SYNCH_MUTEX> guard(mutex_); replied_[id] = true; if ((replied_ & signal_condition_) == signal_condition_) { @@ -43,7 +43,7 @@ void Update_Manager::handle_reply(int id) void Update_Manager::handle_exception(int id) { - ACE_Guard<ACE_SYNCH_MUTEX> guard(mutex_); + ACE_Guard<TAO_SYNCH_MUTEX> guard(mutex_); replied_[id] = true; ++transaction_level_; diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h index caacd63fffe..2fed0651215 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h @@ -15,6 +15,7 @@ #include "ace/Synch_T.h" #include "orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -44,7 +45,7 @@ private: int num_backups_; int transaction_level_; bool& success_; - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp index 43cb5a7a164..57fd368c2dd 100644 --- a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp @@ -141,7 +141,7 @@ int TAO::HTIOP::Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, @@ -162,9 +162,9 @@ TAO::HTIOP::Transport::send_request (TAO_Stub *stub, int TAO::HTIOP::Transport::send_message (TAO_OutputCDR &stream, - TAO_Stub *stub, - int message_semantics, - ACE_Time_Value *max_wait_time) + TAO_Stub *stub, + TAO_Message_Semantics message_semantics, + ACE_Time_Value *max_wait_time) { // Format the message in the stream first if (this->messaging_object_->format_message (stream) != 0) @@ -195,7 +195,7 @@ TAO::HTIOP::Transport::send_message (TAO_OutputCDR &stream, int TAO::HTIOP::Transport::send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time) { @@ -217,8 +217,8 @@ TAO::HTIOP::Transport::send_message_shared (TAO_Stub *stub, int TAO::HTIOP::Transport::generate_request_header (TAO_Operation_Details &opdetails, - TAO_Target_Specification &spec, - TAO_OutputCDR &msg) + TAO_Target_Specification &spec, + TAO_OutputCDR &msg) { // Check whether we have a Bi Dir HTIOP policy set, whether the // messaging objects are ready to handle bidirectional connections diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h index 30e5b313f77..4c806b28a28 100644 --- a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h +++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h @@ -99,7 +99,7 @@ namespace TAO virtual int register_handler (void); virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -110,12 +110,12 @@ namespace TAO virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = + TAO_Message_Semantics message_semantics = Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp index 666af7b030e..e6deb164007 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp @@ -92,13 +92,13 @@ TAO_ComponentContainer_i::create_component_i ( CORBA::dk_Component); // Store the id for this - that's what ComponentDescription takes. - ACE_TString base_id; - this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_, - "id", - base_id); +// ACE_TString base_id; +// this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_, +// "id", +// base_id); this->repo_->config ()->set_string_value (new_key, "base_component", - base_id); + base_path); } CORBA::ULong count = supports_interfaces.length (); @@ -350,14 +350,9 @@ TAO_ComponentContainer_i::create_event_i ( this->repo_, CORBA::dk_Value); - ACE_TString base_value_id; - this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_, - "id", - base_value_id); - this->repo_->config ()->set_string_value (new_key, "base_value", - base_value_id); + base_path); } CORBA::ULong length = abstract_base_values.length (); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp index 281272a5d09..4efe8c1f0dd 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp @@ -157,17 +157,32 @@ TAO_ComponentDef_i::describe_i (void) ); ACE_TString holder; - this->repo_->config ()->get_string_value (this->section_key_, - "base_component", - holder); + int status = + this->repo_->config ()->get_string_value (this->section_key_, + "base_component", + holder); + + if (status == 0) + { + ACE_Configuration_Section_Key base_key; + this->repo_->config ()->expand_path (this->repo_->root_key (), + holder, + base_key, + 0); + this->repo_->config ()->get_string_value (base_key, + "id", + holder); + } + + // If status wasn't 0, holder will contain the empty string. cd.base_component = holder.fast_rep (); CORBA::ULong count = 0; ACE_Configuration_Section_Key supports_key; - int status = this->repo_->config ()->open_section (this->section_key_, - "supported", - 0, - supports_key); + status = this->repo_->config ()->open_section (this->section_key_, + "supported", + 0, + supports_key); if (status == 0) { @@ -425,18 +440,20 @@ TAO_ComponentDef_i::base_component (void) CORBA::ComponentIR::ComponentDef_ptr TAO_ComponentDef_i::base_component_i (void) { - ACE_TString base_id; + ACE_TString base_path; int status = this->repo_->config ()->get_string_value (this->section_key_, "base_component", - base_id); + base_path); if (status != 0) { return CORBA::ComponentIR::ComponentDef::_nil (); } - CORBA::Contained_var obj = this->repo_->lookup_id (base_id.fast_rep ()); + CORBA::Object_var obj = + TAO_IFR_Service_Utils::path_to_ir_object (base_path, + this->repo_); return CORBA::ComponentIR::ComponentDef::_narrow (obj.in ()); } @@ -469,7 +486,7 @@ TAO_ComponentDef_i::base_component_i ( TAO_IFR_Service_Utils::reference_to_path (base_component); // Get the servant's key into the temporary key holder, because - // the name clash checker for base valuetypes is static, and has + // the name clash checker for base components is static, and has // no other way to know about a specific key. this->repo_->config ()->expand_path ( this->repo_->root_key (), @@ -485,7 +502,7 @@ TAO_ComponentDef_i::base_component_i ( this->repo_->config ()->set_string_value ( this->section_key_, "base_component", - base_component->_interface_repository_id () + base_path ); } diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp index ee715d9b553..17b6a7e19ed 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp @@ -2329,14 +2329,9 @@ TAO_Container_i::create_value_common ( this->repo_, CORBA::dk_Value); - ACE_TString base_value_id; - this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_, - "id", - base_value_id); - this->repo_->config ()->set_string_value (new_key, "base_value", - base_value_id); + base_path); } CORBA::ULong length = abstract_base_values.length (); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp index 7e0a06bab6f..59e837ef3de 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp @@ -685,9 +685,24 @@ TAO_ExtValueDef_i::describe_ext_value_i ( "is_truncatable", val); fv_desc->is_truncatable = static_cast<CORBA::Boolean> (val); - this->repo_->config ()->get_string_value (this->section_key_, - "base_value", - holder); + status = + this->repo_->config ()->get_string_value (this->section_key_, + "base_value", + holder); + + if (status == 0) + { + ACE_Configuration_Section_Key base_key; + this->repo_->config ()->expand_path (this->repo_->root_key (), + holder, + base_key, + 0); + this->repo_->config ()->get_string_value (base_key, + "id", + holder); + } + + // If status isn't 0, then holder will be empty anyway. fv_desc->base_value = holder.fast_rep (); fv_desc->type = this->type_i (); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp index 113fb2736ec..c99ff51797f 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp @@ -978,19 +978,15 @@ TAO_IFR_Service_Utils::gen_valuetype_tc_r ( } } - ACE_TString base_id; + ACE_TString base_path; int status = repo->config ()->get_string_value (key, "base_value", - base_id); + base_path); CORBA::TypeCode_var base_tc = CORBA::TypeCode::_nil (); if (status == 0) { - ACE_TString base_path; - repo->config ()->get_string_value (repo->repo_ids_key (), - base_id.fast_rep (), - base_path); ACE_Configuration_Section_Key base_key; repo->config ()->expand_path (repo->root_key (), base_path, diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp index 43562ffb657..07a898a774c 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp @@ -331,8 +331,7 @@ TAO_Port_Utils<T>::create_entry (const char *id, repo->config ()->set_string_value ( new_key, "base_type", - holder - ); + holder); TAO_Port_Utils<T>::set_is_multiple (is_multiple, repo->config (), diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp index 64e07b77dbc..d0da3371543 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp @@ -34,14 +34,16 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'o': // Set the IOR output filename. - this->ior_output_file_ = get_opts.opt_arg (); + ACE_OS::free (this->ior_output_file_); + this->ior_output_file_ = ACE_OS::strdup (get_opts.opt_arg ()); break; case 'p': // Make the IFR persistent this->persistent_ = 1; this->using_registry_ = 0; break; case 'b': - this->persistent_file_ = get_opts.opt_arg (); + ACE_OS::free (this->persistent_file_); + this->persistent_file_ = ACE_OS::strdup (get_opts.opt_arg ()); break; case 'l': #if defined (ACE_HAS_THREADS) diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp index 708abb65821..b74f39c8a74 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp @@ -402,22 +402,19 @@ TAO_ValueDef_i::base_value (void) CORBA::ValueDef_ptr TAO_ValueDef_i::base_value_i (void) { - ACE_TString holder; + ACE_TString base_path; int status = this->repo_->config ()->get_string_value (this->section_key_, "base_value", - holder); + base_path); if (status != 0) { return CORBA::ValueDef::_nil (); } - this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (), - holder.fast_rep (), - holder); CORBA::Object_var obj = - TAO_IFR_Service_Utils::path_to_ir_object (holder, + TAO_IFR_Service_Utils::path_to_ir_object (base_path, this->repo_); return CORBA::ValueDef::_narrow (obj.in ()); @@ -463,7 +460,7 @@ TAO_ValueDef_i::base_value_i (CORBA::ValueDef_ptr base_value) this->repo_->config ()->set_string_value ( this->section_key_, "base_value", - base_value->_interface_repository_id () + base_path ); } @@ -726,7 +723,7 @@ TAO_ValueDef_i::is_a_i (const char *id) { if (ACE_OS::strcmp (id, "IDL:omg.org/CORBA/ValueBase:1.0") == 0) { - return 1; + return true; } ACE_TString holder; @@ -737,21 +734,34 @@ TAO_ValueDef_i::is_a_i (const char *id) // Is it our type? if (ACE_OS::strcmp (holder.fast_rep (), id) == 0) { - return 1; + return true; } - this->repo_->config ()->get_string_value (this->section_key_, - "base_value", + int status = + this->repo_->config ()->get_string_value (this->section_key_, + "base_value", + holder); + + if (status == 0) + { + ACE_Configuration_Section_Key base_key; + this->repo_->config ()->expand_path (this->repo_->root_key (), + holder, + base_key, + 0); + this->repo_->config ()->get_string_value (base_key, + "id", holder); - // Is it our concrete base type? - if (ACE_OS::strcmp (holder.fast_rep (), id) == 0) - { - return 1; + // Is it our concrete base type? + if (ACE_OS::strcmp (holder.fast_rep (), id) == 0) + { + return true; + } } ACE_Configuration_Section_Key bases_key; - int status = + status = this->repo_->config ()->open_section (this->section_key_, "abstract_bases", 0, @@ -759,7 +769,7 @@ TAO_ValueDef_i::is_a_i (const char *id) if (status != 0) { - return 0; + return false; } CORBA::ULong count = 0; @@ -789,11 +799,11 @@ TAO_ValueDef_i::is_a_i (const char *id) if (success) { - return 1; + return true; } } - return 0; + return false; } CORBA::ValueDef::FullValueDescription * @@ -1263,9 +1273,23 @@ TAO_ValueDef_i::describe_value_i (void) "is_truncatable", val); fv_desc->is_truncatable = static_cast<CORBA::Boolean> (val); - this->repo_->config ()->get_string_value (this->section_key_, - "base_value", + status = this->repo_->config ()->get_string_value (this->section_key_, + "base_value", + holder); + + if (status == 0) + { + ACE_Configuration_Section_Key base_key; + this->repo_->config ()->expand_path (this->repo_->root_key (), + holder, + base_key, + 0); + this->repo_->config ()->get_string_value (base_key, + "id", holder); + } + + // If status isn't 0, then holder will contain empty string anyway. fv_desc->base_value = holder.fast_rep (); fv_desc->type = this->type_i (); @@ -1664,9 +1688,24 @@ TAO_ValueDef_i::fill_value_description (CORBA::ValueDescription &desc) tmp = this->is_truncatable_i (); desc.is_truncatable = static_cast<CORBA::Boolean> (tmp); - this->repo_->config ()->get_string_value (this->section_key_, - "base_value", - holder); + int status = + this->repo_->config ()->get_string_value (this->section_key_, + "base_value", + holder); + + if (status == 0) + { + ACE_Configuration_Section_Key base_key; + this->repo_->config ()->expand_path (this->repo_->root_key (), + holder, + base_key, + 0); + this->repo_->config ()->get_string_value (base_key, + "id", + holder); + } + + // If status isn't 0, then holder will be empty anyway. desc.base_value = holder.fast_rep (); } diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp index 73a947638cf..ea2ad6e1df8 100644 --- a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp +++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp @@ -123,14 +123,14 @@ TAO_IOR_Multicast::common_init (const char *ior, // Use ACE_SOCK_Dgram_Mcast factory to subscribe to multicast group. if (this->mcast_nic_.length() != 0) { - if (this->mcast_dgram_.subscribe (this->mcast_addr_, - 1, - ACE_TEXT_CHAR_TO_TCHAR(this->mcast_nic_.c_str())) == -1) + if (this->mcast_dgram_.join (this->mcast_addr_, + 1, + ACE_TEXT_CHAR_TO_TCHAR(this->mcast_nic_.c_str())) == -1) ACE_ERROR_RETURN ((LM_ERROR, "TAO_IOR_Multicast::common_init() %p\n", "subscribe"),-1); } else { - if (this->mcast_dgram_.subscribe (this->mcast_addr_) == -1) + if (this->mcast_dgram_.join (this->mcast_addr_) == -1) ACE_ERROR_RETURN ((LM_ERROR, "TAO_IOR_Multicast::common_init() %p\n", "subscribe"), diff --git a/TAO/orbsvcs/orbsvcs/Makefile.am b/TAO/orbsvcs/orbsvcs/Makefile.am index 5c196087967..2a77be081f3 100644 --- a/TAO/orbsvcs/orbsvcs/Makefile.am +++ b/TAO/orbsvcs/orbsvcs/Makefile.am @@ -2498,7 +2498,6 @@ endif BUILD_EXCEPTIONS if BUILD_ACEXML if BUILD_EXCEPTIONS -if BUILD_ZLIB if !BUILD_ACE_FOR_TAO lib_LTLIBRARIES += libTAO_CosNotification_Persist.la @@ -2512,17 +2511,31 @@ libTAO_CosNotification_Persist_la_CPPFLAGS = \ -I$(TAO_BUILDDIR)/orbsvcs \ -I$(ACE_ROOT)/ACEXML/common \ -DTAO_HAS_TYPED_EVENT_CHANNEL \ - $(ACE_ZZIP_CPPFLAGS) \ - $(ACE_ZLIB_CPPFLAGS) \ -DTAO_NOTIFY_PERSIST_BUILD_DLL +if BUILD_ZLIB +if BUILD_ZZIP +libTAO_CosNotification_Persist_la_CPPFLAGS += \ + $(ACE_ZZIP_CPPFLAGS) \ + $(ACE_ZLIB_CPPFLAGS) +endif BUILD_ZZIP +endif BUILD_ZLIB + libTAO_CosNotification_Persist_la_SOURCES = \ Notify/XML_Loader.cpp \ Notify/XML_Saver.cpp \ Notify/XML_Topology_Factory.cpp libTAO_CosNotification_Persist_la_LDFLAGS = \ - -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@ $(ACE_ZZIP_LDFLAGS) $(ACE_ZLIB_LDFLAGS) + -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@ + +if BUILD_ZLIB +if BUILD_ZZIP +libTAO_CosNotification_Persist_la_LDFLAGS += \ + $(ACE_ZZIP_LDFLAGS) \ + $(ACE_ZLIB_LDFLAGS) +endif BUILD_ZZIP +endif BUILD_ZLIB libTAO_CosNotification_Persist_la_LIBADD = \ $(ACE_BUILDDIR)/ACEXML/parser/parser/libACEXML_Parser.la \ @@ -2539,9 +2552,15 @@ libTAO_CosNotification_Persist_la_LIBADD = \ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +if BUILD_ZLIB +if BUILD_ZZIP +libTAO_CosNotification_Persist_la_LIBADD += \ $(ACE_ZZIP_LIBS) \ $(ACE_ZLIB_LIBS) +endif BUILD_ZZIP +endif BUILD_ZLIB nobase_include_HEADERS += \ Notify/XML_Loader.h \ @@ -2550,7 +2569,6 @@ nobase_include_HEADERS += \ Notify/notify_persist_export.h endif !BUILD_ACE_FOR_TAO -endif BUILD_ZLIB endif BUILD_EXCEPTIONS endif BUILD_ACEXML diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index 640d8d11f4b..bdd28e58252 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -188,7 +188,7 @@ TAO_Naming_Server::parse_args (int argc, switch (c) { case 'd': // debug flag. - TAO_debug_level++; + ++TAO_debug_level; break; case 'o': // outputs the naming service ior to a file. this->ior_file_name_ = get_opts.opt_arg (); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp index e7235ed53ff..68943e2458e 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp @@ -3,16 +3,6 @@ #include "orbsvcs/Naming/Bindings_Iterator_T.h" #include "ace/OS_NS_stdio.h" -// The following #pragma is needed to disable a warning that occurs -// in MSVC 6 due to the overly long debugging symbols generated for -// the ACE_Auto_Basic_Ptr<ACE_Hash_Map_Iterator_Ex<TAO_...> > template -// instance used by some of the methods in this file. -#ifdef _MSC_VER -# pragma warning(disable: 4786) /* identifier was truncated to '255' - characters in the browser - information */ -#endif /* _MSC_VER */ - #include "ace/Auto_Ptr.h" ACE_RCSID (Naming, @@ -67,9 +57,7 @@ TAO_Persistent_Bindings_Map::find (const char *id, TAO_Persistent_ExtId name (id, kind); TAO_Persistent_IntId entry; - if (this->map_->find (name, - entry, - this->allocator_) != 0) + if (this->map_->find (name, entry, this->allocator_) != 0) return -1; else { @@ -117,8 +105,7 @@ TAO_Persistent_Bindings_Map::current_size (void) } int -TAO_Persistent_Bindings_Map::open (size_t hash_table_size, - ACE_Allocator *alloc) +TAO_Persistent_Bindings_Map::open (size_t hash_table_size, ACE_Allocator *alloc) { allocator_ = alloc; @@ -147,8 +134,7 @@ TAO_Persistent_Bindings_Map::open_helper (size_t hash_table_size, } void -TAO_Persistent_Bindings_Map::set (HASH_MAP *map, - ACE_Allocator *alloc) +TAO_Persistent_Bindings_Map::set (HASH_MAP *map, ACE_Allocator *alloc) { allocator_ = alloc; map_ = map; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp index c5caf43bc48..4e6911cd4bb 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp @@ -174,8 +174,7 @@ TAO_Transient_Naming_Context::make_new_context (PortableServer::POA_ptr poa, PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId (poa_id); - poa->activate_object_with_id (id.in (), - context); + poa->activate_object_with_id (id.in (), context); result = context->_this (); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp index d528161d9da..90c4b945a24 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp @@ -55,7 +55,7 @@ TAO_Notify_Buffering_Strategy::update_qos_properties void TAO_Notify_Buffering_Strategy::shutdown (void) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_); if (this->shutdown_) { @@ -75,7 +75,7 @@ TAO_Notify_Buffering_Strategy::oldest_event (void) ACE_Time_Value tv (ACE_Time_Value::max_time); ACE_Message_Block* mb = 0; - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, tv); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, tv); TAO_Notify_Message_Queue::ITERATOR itr (this->msg_queue_); while(itr.next (mb)) { @@ -96,7 +96,7 @@ TAO_Notify_Buffering_Strategy::oldest_event (void) int TAO_Notify_Buffering_Strategy::enqueue (TAO_Notify_Method_Request_Queueable* method_request) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1); if (this->shutdown_) return -1; @@ -168,7 +168,7 @@ TAO_Notify_Buffering_Strategy::dequeue (TAO_Notify_Method_Request_Queueable* &me { ACE_Message_Block *mb; - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1); if ( this->shutdown_ ) return -1; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h index 7b3b9b65e46..354832931d2 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h @@ -89,7 +89,7 @@ private: TAO_Notify_AdminProperties::Ptr admin_properties_; /// The shared global lock used by all the queues. - ACE_SYNCH_MUTEX& global_queue_lock_; + TAO_SYNCH_MUTEX& global_queue_lock_; /// The global queue length - queue length accross all the queues. CORBA::Long& global_queue_length_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp index 63da3f4dfd8..fa15e522f78 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.cpp @@ -19,7 +19,7 @@ TAO_MonitorManager::TAO_MonitorManager (void) int TAO_MonitorManager::init (int argc, ACE_TCHAR* argv[]) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->task_.mutex_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->task_.mutex_, -1); this->task_.argv_.add ("fake_process_name"); ACE_Get_Opt opts (argc, argv, ACE_TEXT ("o:"), 0, 0, @@ -63,9 +63,10 @@ TAO_MonitorManager::fini (void) { if (!CORBA::is_nil (this->task_.orb_.in ())) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->task_.mutex_, -1); - if (!CORBA::is_nil (this->task_.orb_.in ())) + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->task_.mutex_, -1); + if (!CORBA::is_nil (this->task_.orb_.in ())) { this->task_.orb_->shutdown (true); + } } this->task_.wait (); return 0; @@ -74,14 +75,37 @@ TAO_MonitorManager::fini (void) int TAO_MonitorManager::run (void) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->task_.mutex_, -1); - if (!this->run_) - { + bool activate = false; + + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->task_.mutex_, -1); + + // Work around for bug 3108. Need to create MC ORB in main thread + // so any libs are loaded in the parent thread. + // Initialize the ORB + int argc = task_.argv_.argc (); + task_.orb_ = CORBA::ORB_init (argc, task_.argv_.argv () + , task_.mc_orb_name_.c_str()); + + if (!this->run_) { this->run_ = true; - return this->task_.activate (); + activate = true; } + } - return 0; + int status = 0; + if (activate) { + status = this->task_.activate (); + if (status == 0) { + //cj: Wait till the child thread has initialized completely + // It still leaves a tiny race window open, but hopefully not much. + // The race condition R1 is in ORBTask::svc + + this->task_.startup_barrier_.wait (); + } + } + + return status; } int @@ -102,6 +126,8 @@ TAO_MonitorManager::shutdown (void) TAO_MonitorManager::ORBTask::ORBTask (void) : use_name_svc_ (true) + , startup_barrier_ (2) // synch the parent with the single child thread + , mc_orb_name_ ("TAO_MonitorAndControl") { } @@ -110,25 +136,15 @@ TAO_MonitorManager::ORBTask::svc (void) { try { + if (CORBA::is_nil (this->orb_.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) TAO_MonitorManager: Unable to " + "initialize the ORB\n"), + 1); + PortableServer::POA_var poa; { - static const char* monitor_name = "TAO_MonitorAndControl"; - - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->mutex_, -1); - // Initialize the ORB - int argc = this->argv_.argc (); - char orbid[256]; - ACE_OS::sprintf (orbid, - "%s_%d", - monitor_name, - (size_t)ACE_OS::thr_self ()); - this->orb_ = CORBA::ORB_init (argc, this->argv_.argv (), orbid); - - if (CORBA::is_nil (this->orb_.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) TAO_MonitorManager: Unable to " - "initialize the ORB\n"), - 1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->mutex_, -1); CORBA::Object_var obj = this->orb_->resolve_initial_references ("RootPOA"); @@ -162,7 +178,7 @@ TAO_MonitorManager::ORBTask::svc (void) "(%P|%t) TAO_MonitorManager: Unable to " "resolve the IORTable\n"), 1); - iortable->bind(monitor_name, ior.in ()); + iortable->bind(mc_orb_name_.c_str(), ior.in ()); if (this->use_name_svc_) { @@ -170,7 +186,7 @@ TAO_MonitorManager::ORBTask::svc (void) nc.init (this->orb_.in ()); CosNaming::Name name (1); name.length (1); - name[0].id = CORBA::string_dup (monitor_name); + name[0].id = CORBA::string_dup (mc_orb_name_.c_str()); nc->rebind (name, monitor.in ()); } @@ -191,14 +207,14 @@ TAO_MonitorManager::ORBTask::svc (void) } } - // Run the ORB event loop - // NOTE: There is a race condition here. If + // R1: race condition (partially fixed): // TAO_MonitorManager::fini() is called directly after // TAO_MonitorManager::run(), the shutdown call on the ORB could // happen but the ORB::run() loop won't exit. + startup_barrier_.wait (); this->orb_->run (); - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->mutex_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->mutex_, -1); // Destroy the POA and ORB if (!CORBA::is_nil (poa.in ())) diff --git a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h index 6c4384caa8a..699e513e311 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h +++ b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/MonitorManager.h @@ -10,6 +10,7 @@ #include "ace/Task.h" #include "ace/ARGV.h" #include "ace/Atomic_Op.h" +#include "ace/Barrier.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -41,11 +42,13 @@ private: ORBTask (void); virtual int svc (void); - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; ACE_ARGV_T<char> argv_; CORBA::ORB_var orb_; ACE_TString ior_output_; bool use_name_svc_; + ACE_Barrier startup_barrier_; + ACE_TString mc_orb_name_; }; bool run_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/Statistic.h b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/Statistic.h index 79d570f4491..5ac1a563579 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/Statistic.h +++ b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/Statistic.h @@ -31,8 +31,7 @@ public: /// Construct a statistic object. The name and type of the statistic /// will never change once the object is created. - TAO_Statistic (const char* name, - Information_Type type); + TAO_Statistic (const char* name, Information_Type type); /// Clean up any memory allocated by this object virtual ~TAO_Statistic (void); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp index a03960b3607..00a36bb6797 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp @@ -161,7 +161,7 @@ Persistent_File_Allocator::allocate() { Persistent_Storage_Block* result = 0; size_t block_number = 0; - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); if (!this->allocate_block(block_number)) { //@@todo: this should never happen @@ -207,7 +207,7 @@ Persistent_File_Allocator::allocate_nowrite() void Persistent_File_Allocator::used(size_t block_number) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_); if (DEBUG_LEVEL > 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Persistent_File_Allocator::used: %d\n"), static_cast<int> (block_number) @@ -242,7 +242,7 @@ Persistent_File_Allocator::read(Persistent_Storage_Block* psb) { Persistent_Storage_Block** psbtemp = 0; { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_, false); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_, false); size_t queue_size = this->block_queue_.size(); for (size_t idx = 0; !cached && (idx < queue_size); ++idx) { @@ -284,7 +284,7 @@ Persistent_File_Allocator::write(Persistent_Storage_Block* psb) ACE_NEW_RETURN(ourpsb, Persistent_Storage_Block(*psb), false); ourpsb->set_allocator_owns(true); } - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_, false); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_, false); if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Queueing PSB to write block %d\n") , static_cast<int> (psb->block_number ()) @@ -298,7 +298,7 @@ Persistent_File_Allocator::write(Persistent_Storage_Block* psb) void Persistent_File_Allocator::free_block(const size_t block_number) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_); ACE_ASSERT (this->free_blocks_.is_set (block_number)); this->free_blocks_.set_bit(block_number, false); } @@ -306,7 +306,7 @@ Persistent_File_Allocator::free_block(const size_t block_number) bool Persistent_File_Allocator::allocate_block(size_t& block_number) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_, 0); block_number = this->free_blocks_.find_first_bit(false); return true; } @@ -331,7 +331,7 @@ Persistent_File_Allocator::shutdown_thread() if (this->thread_active_) { { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_); this->terminate_thread_ = true; this->wake_up_thread_.signal(); } @@ -352,7 +352,7 @@ Persistent_File_Allocator::run() do_more_work = false; Persistent_Storage_Block * blk = 0; { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_); while (this->block_queue_.is_empty() && !terminate_thread_) { this->wake_up_thread_.wait(); @@ -374,7 +374,7 @@ Persistent_File_Allocator::run() } { Persistent_Storage_Block * blk2 = 0; - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_); this->block_queue_.dequeue_head (blk2); // if this triggers, someone pushed onto the head of the queue // or removed the head from the queue without telling ME. diff --git a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h index db17d13a6cc..79927baa234 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h @@ -192,9 +192,9 @@ private: Random_File pstore_; Bit_Vector free_blocks_; ACE_Unbounded_Queue<Persistent_Storage_Block*> block_queue_; - ACE_SYNCH_MUTEX lock_; - ACE_SYNCH_MUTEX free_blocks_lock_; - ACE_SYNCH_MUTEX queue_lock_; + TAO_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX free_blocks_lock_; + TAO_SYNCH_MUTEX queue_lock_; bool terminate_thread_; bool thread_active_; ACE_SYNCH_CONDITION wake_up_thread_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp b/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp index a106d15f382..5b1c6f1c230 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp @@ -35,7 +35,7 @@ ACE_OFF_T Random_File::size() const { Random_File * const mutable_this = const_cast<Random_File *> (this); - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); ACE_OFF_T original_pos = mutable_this->tell (); mutable_this->ACE_FILE::seek(0, SEEK_END); ACE_OFF_T cursize = mutable_this->tell(); @@ -50,7 +50,7 @@ Random_File::size() const bool Random_File::open(const ACE_TCHAR* filename, size_t block_size) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, false); this->block_size_ = block_size; bool result = (this->close() == 0); @@ -87,7 +87,7 @@ Random_File::open(const ACE_TCHAR* filename, size_t block_size) bool Random_File::write(const size_t block_number, void* buf, bool atomic) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, false); if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Write block %d %c\n"), static_cast<int> (block_number), @@ -122,7 +122,7 @@ Random_File::write(const size_t block_number, void* buf, bool atomic) bool Random_File::read(const size_t block_number, void* buf) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, false); if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Read block %d\n"), static_cast<int> (block_number) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Random_File.h b/TAO/orbsvcs/orbsvcs/Notify/Random_File.h index 87a5513ac50..0f197c6dceb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Random_File.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Random_File.h @@ -28,6 +28,8 @@ #include "ace/streams.h" #include "ace/Synch_T.h" +#include "tao/orbconf.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO_Notify @@ -83,7 +85,7 @@ private: private: size_t block_size_; - mutable ACE_SYNCH_MUTEX lock_; + mutable TAO_SYNCH_MUTEX lock_; }; } /* namespace TAO_Notify */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp index 75b64de8f05..d669f2dde34 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp @@ -43,7 +43,7 @@ Routing_Slip_Persistence_Manager::~Routing_Slip_Persistence_Manager() void Routing_Slip_Persistence_Manager::set_callback(Persistent_Callback* callback) { - ACE_GUARD(ACE_SYNCH_MUTEX, ace_mon, this->lock_); + ACE_GUARD(TAO_SYNCH_MUTEX, ace_mon, this->lock_); this->callback_ = callback; } @@ -73,7 +73,7 @@ Routing_Slip_Persistence_Manager::store_root() versioninfo.wr_ptr()[0] = 1; // Major version number versioninfo.wr_ptr()[1] = 0; // Minor version number versioninfo.wr_ptr(2); - ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result); + ACE_GUARD_RETURN(TAO_SYNCH_MUTEX, ace_mon, this->lock_, result); result = this->build_chain(this->first_routing_slip_block_, this->routing_slip_header_, this->allocated_routing_slip_blocks_, versioninfo); @@ -204,7 +204,7 @@ Routing_Slip_Persistence_Manager::store(const ACE_Message_Block& event, const ACE_Message_Block& routing_slip) { bool result = false; - ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result); + ACE_GUARD_RETURN(TAO_SYNCH_MUTEX, ace_mon, this->lock_, result); if (!this->removed_) { result = store_i(event, routing_slip); @@ -216,7 +216,7 @@ bool Routing_Slip_Persistence_Manager::update(const ACE_Message_Block& routing_slip) { bool result = false; - ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result); + ACE_GUARD_RETURN(TAO_SYNCH_MUTEX, ace_mon, this->lock_, result); // If we have not gotten the event yet or we have no allocator, fail if (!this->removed_) { @@ -232,7 +232,7 @@ bool Routing_Slip_Persistence_Manager::remove() { bool result = false; - ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result); + ACE_GUARD_RETURN(TAO_SYNCH_MUTEX, ace_mon, this->lock_, result); // Assert that this is in the dllist ACE_ASSERT(this->prev_manager_ != this); ACE_ASSERT(this->persisted()); @@ -702,7 +702,7 @@ Routing_Slip_Persistence_Manager::update_next_manager( Routing_Slip_Persistence_Manager* next) { bool result = false; - ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result); + ACE_GUARD_RETURN(TAO_SYNCH_MUTEX, ace_mon, this->lock_, result); ACE_ASSERT(this->persisted()); if (!this->removed_) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h index 0704a315884..6cd9014632a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h @@ -25,6 +25,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Versioned_Namespace.h" +#include "tao/orbconf.h" #include "ace/Message_Block.h" #include "ace/Synch_T.h" #include "ace/Containers_T.h" @@ -238,7 +239,7 @@ private: void remove_from_dllist(); private: - ACE_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX lock_; bool removed_; ACE_UINT64 serial_number_; Persistent_File_Allocator* allocator_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h index 04e21d518dd..70433283f81 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h @@ -62,11 +62,9 @@ protected: //= interface methods virtual CosNotifyChannelAdmin::ProxyType MyType (void); - virtual void connect_sequence_push_supplier (CosNotifyComm::SequencePushSupplier_ptr push_supplier - ); + virtual void connect_sequence_push_supplier (CosNotifyComm::SequencePushSupplier_ptr push_supplier); - virtual void push_structured_events (const CosNotification::EventBatch & notifications - ); + virtual void push_structured_events (const CosNotification::EventBatch & notifications); virtual void disconnect_sequence_push_consumer (void); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h index 995577d761a..40870c9e126 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h @@ -86,7 +86,7 @@ namespace TAO_Notify Routing_Slip_Persistence_Manager & root(); public: - ACE_SYNCH_MUTEX lock; + TAO_SYNCH_MUTEX lock; private: Persistent_File_Allocator allocator_; diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h index bd1bcfe5457..9b098d3d542 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h @@ -85,7 +85,7 @@ namespace TAO /** * Initialize this object. - * @param orbManager our ORB -- we keep var to it. + * @param orb our ORB -- we keep var to it. * @return zero for success; nonzero is process return code for failure. */ int init (CORBA::ORB_ptr orb); diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h index 987b5674f22..53b10accac8 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h @@ -45,7 +45,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL * This class defines the UIPMC profile as specified in the CORBA * specification. * - * @NOTE: This class inherits the ObjectKey from TAO_Profile which may + * @note This class inherits the ObjectKey from TAO_Profile which may * not be needed at all! But lets punt on this for the timebeing. */ class TAO_PortableGroup_Export TAO_UIPMC_Profile : public TAO_Profile diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp index 481c035d6b6..6ae4bf66180 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp @@ -541,7 +541,7 @@ int TAO_UIPMC_Transport<CONNECTION_HANDLER>::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, @@ -562,7 +562,7 @@ template<typename CONNECTION_HANDLER> int TAO_UIPMC_Transport<CONNECTION_HANDLER>::send_message (TAO_OutputCDR &stream, TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { // Format the message in the stream first diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h index 1349e013c4b..1508ef5380e 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h @@ -82,12 +82,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); //@} diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp index 26acb98defb..d428e73a0c8 100644 --- a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp @@ -26,7 +26,7 @@ namespace TAO { CosSchedulingLockList::CosSchedulingLockList(CosSchedulingLockNode *lock_array, const int size, - ACE_SYNCH_MUTEX *mutex) + TAO_SYNCH_MUTEX *mutex) { try { @@ -121,7 +121,7 @@ CosSchedulingLockList::grant_lock(const CosSchedulingLockNode& L) int CosSchedulingLockList::defer_lock(const CosSchedulingLockNode& L, - ACE_SYNCH_MUTEX & mutex) + TAO_SYNCH_MUTEX & mutex) { if (this->free_->next() == 0) { @@ -239,7 +239,7 @@ CosSchedulingLockList::remove_deferred_lock(CosSchedulingLockNode& L) } PCP_Manager::PCP_Manager(CosSchedulingLockList *locks, - ACE_SYNCH_MUTEX *mutex, + TAO_SYNCH_MUTEX *mutex, const RTCORBA::Current_var current) : locks_(locks), mutex_(mutex), diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h index 8caf3a37de7..1c5f492c237 100644 --- a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h +++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h @@ -126,7 +126,7 @@ class CosSchedulingLockList */ CosSchedulingLockList(CosSchedulingLockNode *lock_array, const int size, - ACE_SYNCH_MUTEX *mutex); + TAO_SYNCH_MUTEX *mutex); /** * Calls ACE_Thread::remove() on all conditions in the list; @@ -158,7 +158,7 @@ class CosSchedulingLockList * @param mutex The mutex that guards the locks. */ int defer_lock(const CosSchedulingLockNode& L, - ACE_SYNCH_MUTEX &mutex); + TAO_SYNCH_MUTEX &mutex); /** * Removes a node from the granted lock list whose threadID_ @@ -224,7 +224,7 @@ public: * @param mutex The mutex to guard the locks. */ PCP_Manager(CosSchedulingLockList *locks, - ACE_SYNCH_MUTEX *mutex, + TAO_SYNCH_MUTEX *mutex, const RTCORBA::Current_var current); /** @@ -249,7 +249,7 @@ public: private: int threadID_; /// ID of thread owning this object CosSchedulingLockList *locks_; /// combined list of locks - ACE_SYNCH_MUTEX *mutex_; /// Mutex to guard lock list + TAO_SYNCH_MUTEX *mutex_; /// Mutex to guard lock list RTCORBA::Current_var current_; /// reference to set local priority }; @@ -283,7 +283,7 @@ public: private: CosSchedulingLockList *locks_; /// lists of granted and pending locks - ACE_SYNCH_MUTEX mutex_; /// The mutex for locking the lock list + TAO_SYNCH_MUTEX mutex_; /// The mutex for locking the lock list ACE_Shared_Memory_MM mem_; /// shared memory space char *shm_key_; /// Key for shared memory CosSchedulingLockNode *lock_array_; /// The lock list diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP.mpc b/TAO/orbsvcs/orbsvcs/SSLIOP.mpc index aeff911af87..c5052f37484 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP.mpc +++ b/TAO/orbsvcs/orbsvcs/SSLIOP.mpc @@ -42,7 +42,7 @@ project(SSLIOP) : orbsvcslib, install, security, ssl, pi_server, interceptors, t ./SSLIOP/SSLIOP_Transport.cpp ./SSLIOP/SSLIOP_Util.cpp SSLIOPC.cpp - conditional(vc71, vc8) { + conditional(vc71, vc8, vc9) { ./SSLIOP/params_dup.cpp } else { ./SSLIOP/params_dup.c diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp index 7f05ba7f4c7..374e03542f0 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp @@ -100,13 +100,11 @@ TAO::SSLIOP::Connection_Handler::open (void *) { if (this->transport ()->opened_as () == TAO::TAO_CLIENT_ROLE) { - tph->client_protocol_properties_at_orb_level ( - protocol_properties); + tph->client_protocol_properties_at_orb_level (protocol_properties); } else { - tph->server_protocol_properties_at_orb_level ( - protocol_properties); + tph->server_protocol_properties_at_orb_level (protocol_properties); } } catch (const CORBA::Exception&) @@ -255,8 +253,7 @@ TAO::SSLIOP::Connection_Handler::handle_input (ACE_HANDLE h) int TAO::SSLIOP::Connection_Handler::handle_output (ACE_HANDLE handle) { - const int result = - this->handle_output_eh (handle, this); + int const result = this->handle_output_eh (handle, this); if (result == -1) { @@ -269,7 +266,7 @@ TAO::SSLIOP::Connection_Handler::handle_output (ACE_HANDLE handle) int TAO::SSLIOP::Connection_Handler::handle_timeout (const ACE_Time_Value &, - const void *) + const void *) { // Using this to ensure this instance will be deleted (if necessary) // only after reset_state(). Without this, when this refcount==1 - @@ -343,8 +340,7 @@ TAO::SSLIOP::Connection_Handler::add_transport_to_cache (void) addr.get_port_number () // port }; - TAO_SSLIOP_Endpoint endpoint (&ssl, - &tmpoint); + TAO_SSLIOP_Endpoint endpoint (&ssl, &tmpoint); // Construct a property object TAO_Base_Transport_Property prop (&endpoint); @@ -361,7 +357,7 @@ TAO::SSLIOP::Connection_Handler::process_listen_point_list ( IIOP::ListenPointList &listen_list) { // Get the size of the list - const CORBA::ULong len = listen_list.length (); + CORBA::ULong const len = listen_list.length (); for (CORBA::ULong i = 0; i < len; ++i) { @@ -408,9 +404,8 @@ TAO::SSLIOP::Connection_Handler::process_listen_point_list ( // The property for this handler has changed. Recache the // handler with this property - const int retval = this->transport ()->recache_transport (&prop); - if (retval == -1) - return retval; + if (this->transport ()->recache_transport (&prop) == -1) + return -1; // Make the handler idle and ready for use this->transport ()->make_idle (); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index 675d401ee40..f88b302514b 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -473,13 +473,14 @@ TAO::SSLIOP::Connector::ssliop_connect ( return 0; } - ACE_Auto_Basic_Ptr<TAO::SSLIOP::Connection_Handler> + ACE_Event_Handler_var safe_handler (svc_handler); TAO::SSLIOP::OwnCredentials_var credentials = this->retrieve_credentials (resolver->stub (), svc_handler->peer ().ssl ()); - svc_handler = safe_handler.release (); + safe_handler.release (); + ssl_endpoint->set_sec_attrs (qop, trust, credentials.in()); } @@ -488,6 +489,23 @@ TAO::SSLIOP::Connector::ssliop_connect ( desc, transport) == 0) { + // ...eliminate svc_handle memory leak... + // The make_svc_handler() method creates the service handler and + // bumps the #REFCOUNT# up one extra. The extra reference count + // in TAO_Connect_Creation_Strategy::make_svc_handler() is + // needed in the case when connection completion is pending and + // we are going to wait on a variable in the handler to changes, + // signifying success or failure. Note, that this increment + // cannot be done once the connect() returns since this might be + // too late if another thread pick up the completion and + // potentially deletes the handler before we get a chance to + // increment the reference count. + if (svc_handler) + svc_handler->remove_reference(); + + ACE_Event_Handler_var + safe_handler (svc_handler); + if (TAO_debug_level > 2) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, ") @@ -547,7 +565,7 @@ TAO::SSLIOP::Connector::ssliop_connect ( return 0; } - ACE_Auto_Basic_Ptr<TAO::SSLIOP::Connection_Handler> + ACE_Event_Handler_var safe_handler (svc_handler); // Setup the establishment of trust connection properties, if @@ -571,9 +589,7 @@ TAO::SSLIOP::Connector::ssliop_connect ( else verify_mode = ACE_SSL_Context::instance ()->default_verify_mode (); - ::SSL_set_verify (svc_handler->peer ().ssl (), - verify_mode, - 0); + ::SSL_set_verify (svc_handler->peer ().ssl (), verify_mode, 0); // The "eNULL" cipher disables encryption but still uses a // secure hash (e.g. SHA1 or MD5) to ensure integrity. (Try the @@ -594,7 +610,8 @@ TAO::SSLIOP::Connector::ssliop_connect ( throw CORBA::INV_POLICY (); } - svc_handler = safe_handler.release (); + // svc_handler is never reset..it still has the value + (void)safe_handler.release (); // Get the right synch options ACE_Synch_Options synch_options; diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h index 0666438f85c..f560142bf1c 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h @@ -73,9 +73,7 @@ namespace TAO virtual TAO_Profile *create_profile (TAO_InputCDR& cdr); virtual int check_prefix (const char *endpoint); - virtual TAO_Profile * corbaloc_scan (const char *ior, - size_t &len); - + virtual TAO_Profile * corbaloc_scan (const char *ior, size_t &len); //@} protected: diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp index 368a8dfab51..c4763bb1a25 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp @@ -37,6 +37,8 @@ TAO::SSLIOP_Credentials::SSLIOP_Credentials (::X509 *cert, ::EVP_PKEY *evp) { char * id = BN_bn2hex (bn); + BN_free(bn); + ACE_CString s = ACE_CString ("X509: ") + ACE_CString (const_cast<const char *> (id)); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h index c9f89d93b10..f1b942eaaaa 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h @@ -76,9 +76,7 @@ namespace TAO //@{ virtual char * creds_id (void); - virtual - SecurityLevel3::CredentialsType creds_type (void) - = 0; + virtual SecurityLevel3::CredentialsType creds_type (void) = 0; virtual SecurityLevel3::CredentialsUsage creds_usage (); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp index f61f5dd2a41..db6fa0500aa 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp @@ -345,17 +345,17 @@ TAO::SSLIOP::Protocol_Factory::init (int argc, { if( -1 == ssl_ctx->seed_file (path, -1)) { - errors++; + ++errors; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Failed to load ") ACE_TEXT ("more entropy from <%s>: %m\n"), path)); } else { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_ERROR, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) Loaded ") ACE_TEXT ("more entropy from <%s>\n"), path)); } @@ -374,7 +374,7 @@ TAO::SSLIOP::Protocol_Factory::init (int argc, if (ssl_ctx->load_trusted_ca (ca_file, ca_dir) != 0) { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Unable to load ") ACE_TEXT ("CA certs from %s%s%s\n"), ((ca_file != 0) ? ca_file : ACE_TEXT ("a file pointed to by ") @@ -427,7 +427,7 @@ TAO::SSLIOP::Protocol_Factory::init (int argc, // a dh parameter file and we were unable to actually find it // and load from it. if (TAO_debug_level > 0) - ACE_DEBUG ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) SSLIOP_Factory: ") ACE_TEXT ("unable to set ") ACE_TEXT ("DH parameters <%s>\n"), @@ -467,7 +467,7 @@ TAO::SSLIOP::Protocol_Factory::init (int argc, certificate_type) != 0) { if (TAO_debug_level > 0) - ACE_DEBUG ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Unable to set ") ACE_TEXT ("SSL certificate <%s> ") ACE_TEXT ("in SSLIOP factory.\n"), @@ -492,7 +492,7 @@ TAO::SSLIOP::Protocol_Factory::init (int argc, { if (TAO_debug_level > 0) { - ACE_DEBUG ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) Unable to set ") ACE_TEXT ("SSL private key ") ACE_TEXT ("<%s> in SSLIOP factory.\n"), diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp index d87d423abb4..bf1594f9bbd 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp @@ -54,8 +54,7 @@ TAO::SSLIOP::Transport::handle_input (TAO_Resume_Handle &rh, int result = 0; // Set up the SSLIOP::Current object. - TAO::SSLIOP::State_Guard ssl_state_guard (this->connection_handler_, - result); + TAO::SSLIOP::State_Guard ssl_state_guard (this->connection_handler_, result); if (result == -1) return -1; @@ -89,14 +88,13 @@ TAO::SSLIOP::Transport::recv (char *buf, // Most of the errors handling is common for // Now the message has been read - if (n == -1 - && TAO_debug_level > 4 - && errno != ETIME) + if (n == -1 && TAO_debug_level > 4 && errno != ETIME) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - %p \n"), - ACE_TEXT ("TAO - read message failure ") - ACE_TEXT ("recv_i () \n"))); + ACE_TEXT ("TAO (%P|%t) - SSLIOP_Transport[%d]::recv, ") + ACE_TEXT ("read failure - %m errno %d\n"), + this->id (), + errno)); } // Error handling @@ -120,7 +118,7 @@ int TAO::SSLIOP::Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, message_semantics) == -1) @@ -139,7 +137,7 @@ TAO::SSLIOP::Transport::send_request (TAO_Stub *stub, int TAO::SSLIOP::Transport::send_message (TAO_OutputCDR &stream, TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { // Format the message in the stream first @@ -201,9 +199,7 @@ TAO::SSLIOP::Transport::generate_request_header ( // We are going to pass on this request to the underlying messaging // layer. It should take care of this request - return TAO_Transport::generate_request_header (opdetails, - spec, - msg); + return TAO_Transport::generate_request_header (opdetails, spec, msg); } int @@ -270,8 +266,7 @@ TAO::SSLIOP::Transport::set_bidir_context_info ( return; // Add this info in to the svc_list - opdetails.request_service_context ().set_context (IOP::BI_DIR_IIOP, - cdr); + opdetails.request_service_context ().set_context (IOP::BI_DIR_IIOP, cdr); return; } @@ -289,12 +284,10 @@ TAO::SSLIOP::Transport::get_listen_point ( // Get the array of IIOP (not SSLIOP!) endpoints serviced by the // SSLIOP_Acceptor. - const ACE_INET_Addr *endpoint_addr = - ssliop_acceptor->endpoints (); + const ACE_INET_Addr *endpoint_addr = ssliop_acceptor->endpoints (); // Get the count - const size_t count = - ssliop_acceptor->endpoint_count (); + size_t const count = ssliop_acceptor->endpoint_count (); // The SSL port is stored in the SSLIOP::SSL component associated // with the SSLIOP_Acceptor. @@ -310,7 +303,7 @@ TAO::SSLIOP::Transport::get_listen_point ( ACE_TEXT ("(%P|%t) Could not resolve local host") ACE_TEXT (" address in get_listen_point()\n")), -1); - } + } } @@ -351,7 +344,7 @@ TAO::SSLIOP::Transport::get_listen_point ( if (local_addr == endpoint_addr[index]) { // Get the count of the number of elements - const CORBA::ULong len = listen_point_list.length (); + CORBA::ULong const len = listen_point_list.length (); // Increase the length by 1 listen_point_list.length (len + 1); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h index 68e7f6edf29..02f559cf56d 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h @@ -102,12 +102,12 @@ namespace TAO virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp index 50531374cbd..269eb9c09e8 100644 --- a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp @@ -102,7 +102,7 @@ struct ACE_Scheduler_Factory_Data // The static runtime scheduler. */ - TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy, ACE_SYNCH_MUTEX> scheduler_; + TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy, TAO_SYNCH_MUTEX> scheduler_; // The scheduler. ACE_TSS<ACE_TSS_Type_Adapter<RtecScheduler::Preemption_Priority_t> > diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp index c09321b0d7b..686a1545115 100644 --- a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp +++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp @@ -52,7 +52,7 @@ RPS_Monitor::loads (void) ACE_Time_Value elapsed_time; { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, this->lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, monitor, this->lock_, 0); elapsed_time = current_time - this->last_time_; this->last_time_ = current_time; diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h index 7825b5e5e67..d0b4b5565f7 100644 --- a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h +++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h @@ -80,7 +80,7 @@ private: ACE_Time_Value last_time_; - ACE_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX lock_; }; #include /**/ "ace/post.h" diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h index 2e3fe2247a5..bbcd23168c9 100644 --- a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h +++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h @@ -94,7 +94,7 @@ protected: private: /// The number of requests that have arrived on the server. - ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> request_count_; + ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> request_count_; }; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp index 8c36cbd0349..ee18997a132 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp @@ -13,6 +13,7 @@ #include "ace/Task.h" #include "ace/Barrier.h" #include "ace/OS_NS_unistd.h" +#include "tao/orbconf.h" ACE_RCSID (TAO_RTEC_PERF_TCP_Baseline, client, @@ -39,7 +40,7 @@ private: char const * endpoint_; ACE_Barrier * the_barrier_; int period_in_usecs_; - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; int stopped_; }; @@ -135,7 +136,7 @@ Scavenger_Task::Scavenger_Task(char const * endpoint, void Scavenger_Task::stop(void) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); this->stopped_ = 1; } @@ -163,7 +164,7 @@ Scavenger_Task::svc(void) ACE_OS::sleep (period); { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1); if (this->stopped_) break; } diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp index fcfb77c03ab..6b1ccf7e1a7 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp @@ -167,10 +167,7 @@ int main (int argc, char* argv[]) // TAO_ECG_UDP_Sender::init() takes a TAO_ECG_Refcounted_Endpoint. // If we don't clone our endpoint and pass &endpoint, the sender will // attempt to delete endpoint during shutdown. - TAO_ECG_UDP_Out_Endpoint* clone; - ACE_NEW_RETURN (clone, - TAO_ECG_UDP_Out_Endpoint (endpoint), - -1); + TAO_ECG_Refcounted_Endpoint clone (new TAO_ECG_UDP_Out_Endpoint (endpoint)); sender->init (ec.in (), addr_srv.in (), clone); // Setup the subscription and connect to the EC @@ -187,10 +184,8 @@ int main (int argc, char* argv[]) // TAO_ECG_UDP_Receiver::init() takes a TAO_ECG_Refcounted_Endpoint. // If we don't clone our endpoint and pass &endpoint, the receiver will // attempt to delete endpoint during shutdown. - ACE_NEW_RETURN (clone, - TAO_ECG_UDP_Out_Endpoint (endpoint), - -1); - receiver->init (ec.in (), clone, addr_srv.in ()); + TAO_ECG_Refcounted_Endpoint clone2 (new TAO_ECG_UDP_Out_Endpoint (endpoint)); + receiver->init (ec.in (), clone2, addr_srv.in ()); // Setup the registration and connect to the event channel ACE_SupplierQOS_Factory supp_qos_fact; diff --git a/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h index 4d04baba07e..627bc9ceec4 100644 --- a/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h +++ b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h @@ -160,8 +160,8 @@ private: * Implementation methods should assume the mutex is * locked if necessary. */ - ACE_SYNCH_MUTEX internals_; - typedef ACE_Guard<ACE_SYNCH_MUTEX> InternalGuard; + TAO_SYNCH_MUTEX internals_; + typedef ACE_Guard<TAO_SYNCH_MUTEX> InternalGuard; /** * The orb diff --git a/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp index 7fe89a379d5..67b6bbe4cf1 100644 --- a/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp +++ b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp @@ -80,7 +80,7 @@ namespace TAO::VMCID, \ EFAULT), \ CORBA::COMPLETED_NO); \ - } else ; + } #define KEVORKIAN_DURING(method) \ if (this->death_pending_ == FT_TEST::TestReplica::BEFORE_REPLY ){\ @@ -90,7 +90,7 @@ namespace TAO::VMCID, \ EFAULT), \ CORBA::COMPLETED_NO); \ - } else ; + } #define KEVORKIAN_RETURN(value, method, result) \ if (this->death_pending_ == (FT_TEST::TestReplica::value)){ \ @@ -100,7 +100,7 @@ namespace TAO::VMCID, \ EFAULT), \ CORBA::COMPLETED_NO); \ - } else ; + } #define KEVORKIAN_DURING_RETURN(method, result) \ if (this->death_pending_ == FT_TEST::TestReplica::BEFORE_REPLY ){\ @@ -110,7 +110,7 @@ namespace TAO::VMCID, \ EFAULT), \ CORBA::COMPLETED_NO); \ - } else ; + } ////////////////////////////////////////////////// diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp index 48923bcee78..768372bf632 100644 --- a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp +++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp @@ -35,15 +35,12 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) try { // Retrieve the ORB. - CORBA::ORB_var orb_ = CORBA::ORB_init (argc, - argv, - 0); + CORBA::ORB_var orb_ = CORBA::ORB_init (argc, argv); // ********************************************************************** // Get an object reference for the ORBs IORManipulation object! CORBA::Object_var IORM = - orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, - 0); + orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, 0); TAO_IOP::TAO_IOR_Manipulation_var iorm = TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ()); @@ -51,11 +48,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) // Create a few fictitious IORs CORBA::Object_var name1 = - orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz" - ); + orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz"); CORBA::Object_var name2 = - orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz" - ); + orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz"); // ********************************************************************** // Create IOR list for use with merge_iors. @@ -65,8 +60,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) iors [1] = name2; // ********************************************************************** - CORBA::Object_var merged = - iorm->merge_iors (iors); + CORBA::Object_var merged = iorm->merge_iors (iors); // Check for set and get primaries // Make a dummy property set @@ -77,36 +71,37 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) iorm->set_primary (&prop, name2.in (), merged.in ()); if (retval != 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\tThe primary has been set\n"))); - else { ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\tThe primary has been set\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tError in setting primary\n"))); return -1; } // Check whether a primary has been set - retval = iorm->is_primary_set (&prop, - merged.in ()); + retval = iorm->is_primary_set (&prop, merged.in ()); if (retval) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\tis_primary_set () returned true\n"))); - else { ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\tis_primary_set () returned true\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tis_primary_set () returned false\n"))); - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tSo Exiting\n"))); return -1; } // Get the primary - CORBA::Object_var prim = - iorm->get_primary (&prop, - merged.in ()); + CORBA::Object_var prim = iorm->get_primary (&prop, merged.in ()); // Check whether we got back the right primary if (prim->_is_equivalent (name2.in ())) @@ -116,9 +111,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } else { - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tWe have a problem in getting the right primary\n"))); - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tSo exiting\n"))); return -1; } @@ -135,47 +130,39 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ft_tag_component.group_domain_id = id; // Object group id - ft_tag_component.object_group_id = - (CORBA::ULongLong) 10; + ft_tag_component.object_group_id = (CORBA::ULongLong) 10; // Version - ft_tag_component.object_group_ref_version = - (CORBA::ULong) 5; + ft_tag_component.object_group_ref_version = (CORBA::ULong) 5; // Set the property - retval = iorm->set_property (&prop, - merged.in ()); + retval = iorm->set_property (&prop, merged.in ()); /// Extract the property FT::TagFTGroupTaggedComponent ftc; TAO_FT_IOGR_Property tmp_prop; - retval = - tmp_prop.get_tagged_component (merged.in (), - ftc); + retval = tmp_prop.get_tagged_component (merged.in (), ftc); ACE_DEBUG ((LM_DEBUG, "(%P|%t) Testing for tagged component \n")); - if ((ftc.object_group_ref_version != 5) && (ftc.object_group_id != 10)) ACE_ERROR ((LM_ERROR, "%P|%t) Not working right \n")); - - - if (retval) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\tWe have set the property\n"))); + + orb_->destroy (); } catch (const TAO_IOP::NotFound& userex) { userex._tao_print_exception ( - ACE_TEXT ( - "Unexpected NotFound Exception!\n")); + ACE_TEXT ("Unexpected NotFound Exception!\n")); return -1; } catch (const TAO_IOP::Duplicate& userex) diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc new file mode 100644 index 00000000000..30905c16208 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc @@ -0,0 +1,14 @@ +// -*- MPC -*- +// $Id$ + +project(*test_idl): taoexe, ifr_client { + exename = test_idl + includes += $(TAO_ROOT)/include + + Source_Files { + test_idl.cpp + } + + IDL_Files { + } +} diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt new file mode 100644 index 00000000000..84876c5d797 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt @@ -0,0 +1,4 @@ +(tao573 Similar to tao567, but not with an abstract base valuetype) + +when the describe_ext_value() call is done, this produces +BAD_PARAM exception incorrectly. diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl new file mode 100755 index 00000000000..259a742dfbf --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl @@ -0,0 +1,67 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +$status = 0; +my $exec_extn=""; +if ($^O eq "MSWin32") { + $exec_extn=".exe"; +} +$ifr_service= "$ENV{ACE_ROOT}/bin/IFR_Service"; +if (! -e $ifr_service . $exec_extn ) { + $ifr_service= "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/IFR_Service"; + if (! -e $ifr_service . $exec_extn ) { + $ifr_service = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/Release/IFR_Service"; + if (! -e $ifr_service . $exec_extn ) { + print STDERR "ERROR: IFR_Service not found.\n"; + exit 1; + } + } +} +$iorfile = PerlACE::LocalFile ("ifr.ior"); +unlink $iorfile; + +print STDERR "\n\n==== Running Forward Declared ValueType Definition test\n"; + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("$ifr_service", "-o $iorfile"); +} +else { + $SV = new PerlACE::Process ("$ifr_service", "-o $iorfile"); +} + +print STDERR "Starting IFR Service\n"; +$SV->Spawn (); +if (PerlACE::waitforfile_timed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$LOADER = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_ifr", + "-ORBInitRef InterfaceRepository=file://$iorfile test.idl"); +print STDERR "Loading test.idl into IFR service\n"; +$status = $LOADER->SpawnWaitKill (15); +if ($status != 0) { + print STDERR "ERROR: IFR Loading returned $status\n"; +} + +print STDERR "Running test_idl\n"; +$TEST = new PerlACE::Process ("test_idl", "-i file://$iorfile -s IDL:M1/VT:1.0"); +$status = $TEST->SpawnWaitKill (15); +if ($status != 0) { + print STDERR "ERROR: test_idl returned $status\n"; +} + +print STDERR "Stopping IFR\n"; +$SV->Kill(); $SV->TimedWait (1); +unlink $iorfile; + +exit $status; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl new file mode 100644 index 00000000000..41d1acf9c89 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl @@ -0,0 +1,22 @@ +// $Id$ + +module C1 +{ + valuetype EB // NOT abstract + { + }; +}; + +module M1 +{ + valuetype VT; // Forward declare +}; + +module M1 +{ + valuetype VT : // Full definition + ::C1::EB + { + public long id; + }; +}; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp new file mode 100644 index 00000000000..d17ac410255 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp @@ -0,0 +1,126 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "tao/ORB.h" +#include "tao/IFR_Client/IFR_ComponentsC.h" + +namespace +{ + const char *ifr_ior_file = 0; + const char *idl_value = 0; +} + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "i:s:"); + const unsigned char full_success = 0x03; + unsigned char success = 0; + + while (true) + { + int c = get_opts (); + if (success == full_success) + { + break; + } + + if (c == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s" + " -i <ifr_ior>" + " -s <idl_valuetype>" + "\n", + argv [0]), + -1); + } + + switch (c) + { + case 'i': + ifr_ior_file = get_opts.opt_arg (); + success |= 0x01; + break; + case 's': + idl_value = get_opts.opt_arg (); + success |= 0x02; + break; + } + } + + // Indicates sucessful parsing of the command line + return 0; +} + +// ---------------------------------------------------------------------- + +int main (int argc, char** argv) +{ + // init orb + CORBA::ORB_var the_orb = + CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) == -1) + { + return -1; + } + + // get IFR + CORBA::Object_var objref = + the_orb->string_to_object (ifr_ior_file); + if (objref.in () == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "The received objref is nil\n"), + -1); + } + + CORBA::ComponentIR::Repository_var the_repo_ref; + try + { + the_repo_ref = CORBA::ComponentIR::Repository::_narrow (objref.in ()); + } + catch (CORBA::Exception &ex) + { + ex._tao_print_exception ("Can't narrow the IFR:"); + return 1; + } + + // search in repository + CORBA::Contained_var current_contained = + the_repo_ref->lookup_id (idl_value); + if (CORBA::is_nil(current_contained.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Can't look up the valuetype\n"), + -1); + } + + // get value type definition + CORBA::ExtValueDef_var value_def = + CORBA::ExtValueDef::_narrow (current_contained.in ()); + CORBA::ExtValueDef::ExtFullValueDescription * value_descr; + try + { + value_descr = value_def->describe_ext_value (); + } + catch (CORBA::Exception &ex) + { + ex._tao_print_exception ("Can't describe_ext_value:"); + return 1; + } + + CORBA::ValueMemberSeq& the_value_members = + value_descr->members; + for (CORBA::ULong ct = 0; ct < the_value_members.length (); ++ct) + { + const CORBA::ValueMember& current_member = + the_value_members [ct]; + ACE_DEBUG ((LM_DEBUG, + "value type member '%s'\n", + current_member.name.in ())); + } + + return 0; +} diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3174_Regression.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3174_Regression.mpc new file mode 100644 index 00000000000..fa0bd0c8d2d --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/Bug_3174_Regression.mpc @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + +project(*test_idl): taoexe, ifr_client,dynamicany { + exename = test_idl + + Source_Files { + test_idl.cpp + } + + IDL_Files { + } +} diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/ReadMe.txt b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/ReadMe.txt new file mode 100644 index 00000000000..5f7f1a6530b --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/ReadMe.txt @@ -0,0 +1,4 @@ +The IFR was returning incorrect results for enums: + +For m1::c2 the TAO_IFR function type()->kind() of CORBA::ConstantDef was returning 0 +instead of the value "tk_enum" and then wasn't handling the value of such a constant. diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/run_test.pl new file mode 100755 index 00000000000..45107822a57 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/run_test.pl @@ -0,0 +1,67 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +$status = 0; +my $exec_extn=""; +if ($^O eq "MSWin32") { + $exec_extn=".exe"; +} +$ifr_service= "$ENV{ACE_ROOT}/bin/IFR_Service"; +if (! -e $ifr_service . $exec_extn ) { + $ifr_service= "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/IFR_Service"; + if (! -e $ifr_service . $exec_extn ) { + $ifr_service = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/Release/IFR_Service"; + if (! -e $ifr_service . $exec_extn ) { + print STDERR "ERROR: IFR_Service not found.\n"; + exit 1; + } + } +} +$iorfile = PerlACE::LocalFile ("ifr.ior"); +unlink $iorfile; + +print STDERR "\n\n==== Running Forward Declared ValueType Definition test\n"; + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("$ifr_service", "-o $iorfile"); +} +else { + $SV = new PerlACE::Process ("$ifr_service", "-o $iorfile"); +} + +print STDERR "Starting IFR Service\n"; +$SV->Spawn (); +if (PerlACE::waitforfile_timed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$LOADER = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_ifr", + "-ORBInitRef InterfaceRepository=file://$iorfile test.idl"); +print STDERR "Loading test.idl into IFR service\n"; +$status = $LOADER->SpawnWaitKill (15); +if ($status != 0) { + print STDERR "ERROR: IFR Loading returned $status\n"; +} + +print STDERR "Running test_idl\n"; +$TEST = new PerlACE::Process ("test_idl", "-i file://$iorfile"); +$status = $TEST->SpawnWaitKill (15); +if ($status != 0) { + print STDERR "ERROR: test_idl returned $status\n"; +} + +print STDERR "Stopping IFR\n"; +$SV->Kill(); $SV->TimedWait (1); +unlink $iorfile; + +exit $status; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test.idl new file mode 100644 index 00000000000..0983f644770 --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test.idl @@ -0,0 +1,8 @@ +// $Id$ +// TAO579 + +module m1 +{ + enum e1 {e1_1, e1_2}; + const e1 c2 = e1_2; +}; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test_idl.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test_idl.cpp new file mode 100644 index 00000000000..66297dc072f --- /dev/null +++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/test_idl.cpp @@ -0,0 +1,158 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/OS_NS_string.h" +#include "tao/DynamicAny/DynamicAny.h" +#include "tao/ORB.h" +#include "tao/IFR_Client/IFR_ComponentsC.h" + +namespace +{ + const char *ifr_ior_file = 0; +} + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "i:s:"); + const unsigned char full_success = 0x01; + unsigned char success = 0; + + while (true) + { + int c = get_opts (); + if (success == full_success) + { + break; + } + + if (c == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s" + " -i <ifr_ior>" + "\n", + argv [0]), + -1); + } + + switch (c) + { + case 'i': + ifr_ior_file = get_opts.opt_arg (); + success |= 0x01; + break; + } + } + + // Indicates sucessful parsing of the command line + return 0; +} + +// ---------------------------------------------------------------------- + +int main (int argc, char** argv) +{ + int result= 0; + ACE_DEBUG (( LM_DEBUG, "Start\n" )); + // init orb + CORBA::ORB_var the_orb = + CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) == -1) + { + return -1; + } + + try + { + ACE_DEBUG (( LM_DEBUG, "Get IFR\n" )); + CORBA::Object_var objref = + the_orb->string_to_object (ifr_ior_file); + if (objref.in () == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "The received objref is nil\n"), + -1); + } + + ACE_DEBUG (( LM_DEBUG, "Narrow IFR\n" )); + CORBA::ComponentIR::Repository_var the_repo_ref; + the_repo_ref = CORBA::ComponentIR::Repository::_narrow (objref.in ()); + + ACE_DEBUG (( LM_DEBUG, "Obtaining DynamicAny\n" )); + CORBA::Object_var factory_obj = + the_orb->resolve_initial_references ("DynAnyFactory"); + DynamicAny::DynAnyFactory_var dynanyfactory = + DynamicAny::DynAnyFactory::_narrow (factory_obj.in ()); + + ACE_DEBUG (( LM_DEBUG, "\nLook up c2\n" )); + CORBA::Contained_var c2 = + the_repo_ref->lookup_id ("IDL:m1/c2:1.0"); + if (CORBA::is_nil (c2.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Can't look up the const m1/c2\n"), + -1); + } + CORBA::ConstantDef_var c2_def = CORBA::ConstantDef::_narrow (c2.in ()); + CORBA::String_var c2_name= c2_def->absolute_name (); + CORBA::TypeCode_var c2_tc = c2_def->type (); + CORBA::String_var c2_id = c2_tc->id (); + ACE_DEBUG (( LM_DEBUG, "constant \"%s\" is type \"%s\"", c2_name.in (), c2_id.in ())); + CORBA::TCKind c2_tckind = c2_tc->kind (); + ACE_DEBUG (( LM_DEBUG, ", tkkind %d", c2_tckind )); + if (CORBA::tk_enum == c2_tckind) + { + ACE_DEBUG (( LM_DEBUG, " (CORBA::tk_enum)\n" )); + CORBA::Any_var the_value = c2_def->value (); + + DynamicAny::DynAny_var dany = + dynanyfactory->create_dyn_any (the_value.in ()); + DynamicAny::DynEnum_var denum = + DynamicAny::DynEnum::_narrow (dany.in ()); + CORBA::String_var the_strValue = denum->get_as_string (); + CORBA::ULong the_intValue = denum->get_as_ulong (); + + ACE_DEBUG ((LM_DEBUG, "Whose value is \"%s\" which has an integer value of %d\n", + the_strValue.in (), the_intValue )); + + if (0 == ACE_OS::strcmp( "e1_2", the_strValue.in () )) + { + ACE_DEBUG ((LM_DEBUG, "The string value is correct\n" )); + } + else + { + ACE_DEBUG ((LM_DEBUG, "ERROR: The string value should be \"e1_2\"\n" )); + result = -1; + } + if (1 == the_intValue ) + { + ACE_DEBUG ((LM_DEBUG, "The corresponding integer value is correct\n" )); + } + else + { + ACE_DEBUG ((LM_DEBUG, "ERROR: The corresponding integer value should be 1\n" )); + result = -1; + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "\nERROR: Wrong tkkind for m1::c2, should be %d\n", CORBA::tk_enum)); + result= -1; + } + } + catch (CORBA::Exception &ex) + { + ex._tao_print_exception ("ERROR: CORBA Exception"); + result= -1; + } + catch (...) + { + ACE_DEBUG ((LM_DEBUG, "ERROR: UNKNOWN Excetion\n")); + result= -1; + } + + ACE_DEBUG (( LM_DEBUG, "\nDone\n" )); + return result; +} diff --git a/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp b/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp index 2522e005b08..67b09574776 100644 --- a/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp @@ -222,5 +222,5 @@ TAO_Notify_Tests_LookupManager::resolve (CosNotifyFilter::FilterAdmin_var& filte } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<TAO_Notify_Tests_LookupManager, ACE_Thread_Mutex> *ACE_Singleton<TAO_Notify_Tests_LookupManager, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<TAO_Notify_Tests_LookupManager, TAO_SYNCH_MUTEX> *ACE_Singleton<TAO_Notify_Tests_LookupManager, TAO_SYNCH_MUTEX>::singleton_; #endif /*ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp index f3fc0593c6f..4716b4d1a8d 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp @@ -347,5 +347,5 @@ TAO_Notify_Tests_Periodic_Supplier::dump_stats (ACE_TCHAR* msg, int dump_samples } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<Base_Time, ACE_Thread_Mutex> *ACE_Singleton<Base_Time, ACE_Thread_Mutex>::singleton_; +template ACE_Singleton<Base_Time, TAO_SYNCH_MUTEX> *ACE_Singleton<Base_Time, TAO_SYNCH_MUTEX>::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client.cpp b/TAO/orbsvcs/tests/Security/Big_Request/client.cpp index 9d1672e8db9..2385f7bf3db 100644 --- a/TAO/orbsvcs/tests/Security/Big_Request/client.cpp +++ b/TAO/orbsvcs/tests/Security/Big_Request/client.cpp @@ -46,10 +46,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) env += cert_file; ACE_OS::putenv (env.c_str ()); - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - ""); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); if (::parse_args (argc, argv) != 0) return 1; diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server.cpp b/TAO/orbsvcs/tests/Security/Big_Request/server.cpp index 743fbe4865c..b12b2543792 100644 --- a/TAO/orbsvcs/tests/Security/Big_Request/server.cpp +++ b/TAO/orbsvcs/tests/Security/Big_Request/server.cpp @@ -4,6 +4,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" #include "ace/SString.h" +#include "ace/Task.h" ACE_RCSID (Big_Request, server, @@ -12,10 +13,36 @@ ACE_RCSID (Big_Request, const char *ior_output_file = 0; const char *cert_file = "cacert.pem"; +class OrbTask : public ACE_Task_Base +{ +public: + OrbTask(const CORBA::ORB_ptr orb) + : orb_(CORBA::ORB::_duplicate(orb)) + { + } + + virtual int svc() + { + try + { + this->orb_->run (); + } + catch (const CORBA::Exception&) + { + } + return 0; + } + +private: + CORBA::ORB_var orb_; +}; + +static int n_threads = 1; + int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:"); + ACE_Get_Opt get_opts (argc, argv, "o:t:"); int c; while ((c = get_opts ()) != -1) @@ -24,11 +51,15 @@ parse_args (int argc, char *argv[]) case 'o': ior_output_file = get_opts.opt_arg (); break; + case 't': + n_threads = ACE_OS::atoi(get_opts.opt_arg()); + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "Usage: %s " "-o <iorfile>" + "-t <thread count>" "\n", argv [0]), -1); @@ -86,7 +117,14 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_OS::fclose (output_file); } - orb->run (); + OrbTask task(orb.in()); + + if (task.activate (THR_NEW_LWP | THR_JOINABLE, + n_threads) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot activate threads\n"), + 1); + task.wait(); ACE_DEBUG ((LM_DEBUG, "\n" diff --git a/TAO/orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/NotificationServiceMonitor.cpp b/TAO/orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/NotificationServiceMonitor.cpp index a1a23606db9..1fce3c59656 100644 --- a/TAO/orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/NotificationServiceMonitor.cpp +++ b/TAO/orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/NotificationServiceMonitor.cpp @@ -2,6 +2,7 @@ #include "orbsvcs/Notify/MonitorControl/Statistic_Registry.h" #include "orbsvcs/Notify/MonitorControl/Statistic.h" #include "orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.h" +#include "tao/TAO_Singleton_Manager.h" void error(const char* msg) diff --git a/TAO/orbsvcs/tests/unit/Notify/MC/Statistic/Statistic.cpp b/TAO/orbsvcs/tests/unit/Notify/MC/Statistic/Statistic.cpp index 8c20349d56f..ef1f6af02c5 100644 --- a/TAO/orbsvcs/tests/unit/Notify/MC/Statistic/Statistic.cpp +++ b/TAO/orbsvcs/tests/unit/Notify/MC/Statistic/Statistic.cpp @@ -1,5 +1,6 @@ // $Id$ #include "orbsvcs/Notify/MonitorControl/Statistic.h" +#include "ace/Log_Msg.h" void error(const char* msg) diff --git a/TAO/orbsvcs/tests/unit/Notify/MC/Statistic_Registry/Statistic_Registry.cpp b/TAO/orbsvcs/tests/unit/Notify/MC/Statistic_Registry/Statistic_Registry.cpp index 42d6b7b5839..09285576ded 100644 --- a/TAO/orbsvcs/tests/unit/Notify/MC/Statistic_Registry/Statistic_Registry.cpp +++ b/TAO/orbsvcs/tests/unit/Notify/MC/Statistic_Registry/Statistic_Registry.cpp @@ -1,6 +1,7 @@ // $Id$ #include "orbsvcs/Notify/MonitorControl/Statistic_Registry.h" #include "orbsvcs/Notify/MonitorControl/Statistic.h" +#include "tao/TAO_Singleton_Manager.h" void error(const char* msg) diff --git a/TAO/performance-tests/CSD_Strategy/TestInf/AppShutdown.h b/TAO/performance-tests/CSD_Strategy/TestInf/AppShutdown.h index 7249def17bf..eee1be40ac1 100644 --- a/TAO/performance-tests/CSD_Strategy/TestInf/AppShutdown.h +++ b/TAO/performance-tests/CSD_Strategy/TestInf/AppShutdown.h @@ -24,7 +24,7 @@ class CSD_PT_TestInf_Export AppShutdown private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; LockType lock_; diff --git a/TAO/performance-tests/CSD_Strategy/TestInf/ClientEngine.h b/TAO/performance-tests/CSD_Strategy/TestInf/ClientEngine.h index 63f34fd4f76..447fd230557 100644 --- a/TAO/performance-tests/CSD_Strategy/TestInf/ClientEngine.h +++ b/TAO/performance-tests/CSD_Strategy/TestInf/ClientEngine.h @@ -25,7 +25,7 @@ class ClientEngine; typedef TAO_Intrusive_Ref_Count_Handle<ClientEngine> ClientEngine_Handle; -class CSD_PT_TestInf_Export ClientEngine : public TAO_Intrusive_Ref_Count_Base<ACE_SYNCH_MUTEX> +class CSD_PT_TestInf_Export ClientEngine : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { public: diff --git a/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.h b/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.h index a99ccc6ad43..d7c8ce5a488 100644 --- a/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.h +++ b/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.h @@ -39,7 +39,7 @@ class CSD_PT_TestInf_Export ClientTask : public ACE_Task_Base private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; typedef ACE_Vector<ClientEngine_Handle> EngineVector; diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp index b77e2d7eea2..7a7747e763a 100644 --- a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp +++ b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp @@ -56,7 +56,7 @@ struct Synchronizers { } - ACE_SYNCH_MUTEX worker_lock_; + TAO_SYNCH_MUTEX worker_lock_; ACE_Event workers_; CORBA::ULong workers_ready_; CORBA::ULong number_of_workers_; @@ -253,7 +253,7 @@ start_synchronization (test_ptr test, } { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, synchronizers.worker_lock_, -1); @@ -297,7 +297,7 @@ int end_synchronization (Synchronizers &synchronizers) { { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, synchronizers.worker_lock_, -1); @@ -497,7 +497,7 @@ Paced_Worker::deadline_for_current_call (CORBA::ULong i) void Paced_Worker::print_stats (ACE_hrtime_t test_end) { - ACE_GUARD (ACE_SYNCH_MUTEX, + ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->synchronizers_.worker_lock_); @@ -737,7 +737,7 @@ void Continuous_Worker::print_stats (ACE_Sample_History &history, ACE_hrtime_t test_end) { - ACE_GUARD (ACE_SYNCH_MUTEX, + ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->synchronizers_.worker_lock_); diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp index 9e14682e7be..b920fd9f483 100644 --- a/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp @@ -9,6 +9,7 @@ #include "tao/ORB_Core.h" #include "tao/TypeCodeFactory_Adapter.h" #include "tao/CDR.h" +#include "tao/SystemException.h" #ifndef __ACE_INLINE__ diff --git a/TAO/tao/Bind_Dispatcher_Guard.h b/TAO/tao/Bind_Dispatcher_Guard.h index ca4d11eb4e5..ec68893ba66 100644 --- a/TAO/tao/Bind_Dispatcher_Guard.h +++ b/TAO/tao/Bind_Dispatcher_Guard.h @@ -37,7 +37,7 @@ public: int unbind_dispatcher (void); /// State information - enum + enum TAO_Bind_Dispatcher_Status { /// Unbind the dispatcher UNBIND = 0, @@ -46,13 +46,13 @@ public: }; /// Get status - int status (void) const; + TAO_Bind_Dispatcher_Status status (void) const; /// Set status - void status (int status); + void status (TAO_Bind_Dispatcher_Status status); private: - int status_; + TAO_Bind_Dispatcher_Status status_; CORBA::ULong request_id_; TAO_Reply_Dispatcher* rd_; TAO_Transport_Mux_Strategy* tms_; diff --git a/TAO/tao/Bind_Dispatcher_Guard.inl b/TAO/tao/Bind_Dispatcher_Guard.inl index c4a3477f7ee..e7e069797e4 100644 --- a/TAO/tao/Bind_Dispatcher_Guard.inl +++ b/TAO/tao/Bind_Dispatcher_Guard.inl @@ -19,12 +19,12 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void -TAO_Bind_Dispatcher_Guard::status (int s) +TAO_Bind_Dispatcher_Guard::status (TAO_Bind_Dispatcher_Status s) { this->status_ = s; } -ACE_INLINE int +ACE_INLINE TAO_Bind_Dispatcher_Guard::TAO_Bind_Dispatcher_Status TAO_Bind_Dispatcher_Guard::status (void) const { return this->status_; diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 6b7e3f34119..60917fd0f99 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -74,7 +74,7 @@ TAO_OutputCDR::TAO_OutputCDR (size_t size, , more_fragments_ (false) , request_id_ (0) , stub_ (0) - , message_semantics_ (-1) + , message_semantics_ (TAO_Transport::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR1_ENTER); @@ -110,7 +110,7 @@ TAO_OutputCDR::TAO_OutputCDR (char *data, , more_fragments_ (false) , request_id_ (0) , stub_ (0) - , message_semantics_ (-1) + , message_semantics_ (TAO_Transport::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR2_ENTER); @@ -139,7 +139,7 @@ TAO_OutputCDR::TAO_OutputCDR (char *data, , more_fragments_ (false) , request_id_ (0) , stub_ (0) - , message_semantics_ (-1) + , message_semantics_ (TAO_Transport::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR3_ENTER); @@ -159,7 +159,7 @@ TAO_OutputCDR::TAO_OutputCDR (ACE_Message_Block *data, , more_fragments_ (false) , request_id_ (0) , stub_ (0) - , message_semantics_ (-1) + , message_semantics_ (TAO_Transport::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR4_ENTER); @@ -182,7 +182,7 @@ TAO_OutputCDR::TAO_OutputCDR (ACE_Data_Block *data_block, , more_fragments_ (false) , request_id_ (0) , stub_ (0) - , message_semantics_ (-1) + , message_semantics_ (TAO_Transport::TAO_TWOWAY_REQUEST) , timeout_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR5_ENTER); diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index 11b32b908d9..1123d618b14 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -53,10 +53,10 @@ #include /**/ "tao/TAO_Export.h" #include "tao/Basic_Types.h" #include "tao/GIOP_Message_Version.h" +#include "tao/Transport.h" #include "ace/CDR_Stream.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_ORB_Core; @@ -183,7 +183,7 @@ public: /// Set fragmented message attributes. void message_attributes (CORBA::ULong request_id, TAO_Stub * stub, - int message_semantics, + TAO_Transport::TAO_Message_Semantics message_semantics, ACE_Time_Value * timeout); /// Fragmented message request ID. @@ -193,7 +193,7 @@ public: TAO_Stub * stub (void) const; /// Message semantics (twoway, oneway, reply) - int message_semantics (void) const; + TAO_Transport::TAO_Message_Semantics message_semantics (void) const; /// Maximum time to wait for outgoing message to be sent. ACE_Time_Value * timeout (void) const; @@ -231,7 +231,7 @@ private: /** * @see TAO_Transport */ - int message_semantics_; + TAO_Transport::TAO_Message_Semantics message_semantics_; /// Request/reply send timeout. ACE_Time_Value * timeout_; diff --git a/TAO/tao/CDR.inl b/TAO/tao/CDR.inl index 4457de2c02f..5f4f73bbd53 100644 --- a/TAO/tao/CDR.inl +++ b/TAO/tao/CDR.inl @@ -24,7 +24,7 @@ TAO_OutputCDR::more_fragments (bool more) ACE_INLINE void TAO_OutputCDR::message_attributes (CORBA::ULong request_id, TAO_Stub * stub, - int message_semantics, + TAO_Transport::TAO_Message_Semantics message_semantics, ACE_Time_Value * timeout) { this->request_id_ = request_id; @@ -45,7 +45,7 @@ TAO_OutputCDR::stub (void) const return this->stub_; } -ACE_INLINE int +ACE_INLINE TAO_Transport::TAO_Message_Semantics TAO_OutputCDR::message_semantics (void) const { return this->message_semantics_; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h index e3b85853f9f..9aa378290ac 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h @@ -51,7 +51,7 @@ namespace TAO * TBD - Add description */ class TAO_CSD_TP_Export TP_Custom_Request_Operation - : public TAO_Intrusive_Ref_Count_Base<ACE_SYNCH_MUTEX> + : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { public: diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Request.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Request.h index 104d741d3b9..38af35b0a2a 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Request.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Request.h @@ -49,7 +49,7 @@ namespace TAO * object. */ class TAO_CSD_TP_Export TP_Request - : public TAO_Intrusive_Ref_Count_Base<ACE_SYNCH_MUTEX> + : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { public: diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State.h index dbfebedb64c..4f9a544d6cd 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State.h @@ -16,6 +16,7 @@ #include /**/ "ace/pre.h" #include "tao/CSD_ThreadPool/CSD_TP_Export.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -53,7 +54,7 @@ namespace TAO * */ class TAO_CSD_TP_Export TP_Servant_State - : public TAO_Intrusive_Ref_Count_Base<ACE_SYNCH_MUTEX> + : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { public: diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h index ccbec859ea4..6dba5ec2376 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h @@ -75,7 +75,7 @@ namespace TAO TP_Servant_State::HandleType, ACE_Hash<void*>, ACE_Equal_To<void*>, - ACE_SYNCH_MUTEX> MapType; + TAO_SYNCH_MUTEX> MapType; /// The underlying map of servant state objects. MapType map_; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h index 2056f1ab032..cef6fe53ec0 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h @@ -77,7 +77,7 @@ namespace TAO }; /// Thread lock type - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; /// Thread guard type typedef ACE_Guard<LockType> GuardType; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp index cf1ae10c457..eccb707d0a7 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp @@ -143,12 +143,7 @@ TAO::CSD::TP_Task::svc() // Put the thread id into a collection which is used to check whether // the orb shutdown is called by one of the threads in the pool. ACE_thread_t thr_id = ACE_OS::thr_self (); - if (this->activated_threads_.set(thr_id, this->num_threads_) == -1) - { - ACE_ERROR_RETURN((LM_ERROR, - ACE_TEXT("(%P|%t)TP_Task::svc: number of threads is out of range \n")), - 0); - } + this->activated_threads_.push_back(thr_id); ++this->num_threads_; this->active_workers_.signal(); } @@ -176,6 +171,12 @@ TAO::CSD::TP_Task::svc() return 0; } + if (this->deferred_shutdown_initiated_) + { + this->deferred_shutdown_initiated_ = false; + return 0; + } + // There is no need to visit the queue if it is empty. if (!this->queue_.is_empty()) { @@ -265,7 +266,7 @@ TAO::CSD::TP_Task::close(u_long flag) // Signal all worker threads waiting on the work_available_ condition. this->work_available_.broadcast(); - size_t num_waiting_threads = 0; + bool calling_thread_in_tp = false; ACE_thread_t my_thr_id = ACE_OS::thr_self (); @@ -275,16 +276,17 @@ TAO::CSD::TP_Task::close(u_long flag) for (size_t i = 0; i < size; i ++) { - ACE_thread_t thr_id = 0; - if (activated_threads_.get (thr_id, i) == 0 && thr_id == my_thr_id) + if (this->activated_threads_[i] == my_thr_id) { - num_waiting_threads = 1; + calling_thread_in_tp = true; + this->deferred_shutdown_initiated_ = true; break; } } // Wait until all worker threads have shutdown. - while (this->num_threads_ != num_waiting_threads) + size_t target_num_threads = calling_thread_in_tp ? 1 : 0; + while (this->num_threads_ != target_num_threads) { this->active_workers_.wait(); } @@ -292,6 +294,9 @@ TAO::CSD::TP_Task::close(u_long flag) // Cancel all requests. TP_Cancel_Visitor cancel_visitor; this->queue_.accept_visitor(cancel_visitor); + + this->opened_ = false; + this->shutdown_initiated_ = false; } return 0; diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h index e1d85cedf01..c3fec3a6479 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h @@ -28,6 +28,7 @@ #include "ace/Task.h" #include "ace/Synch.h" #include "ace/Containers_T.h" +#include "ace/Vector_T.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -135,6 +136,10 @@ namespace TAO /// Flag used to initiate a shutdown request to all worker threads. bool shutdown_initiated_; + /// Complete shutdown needed to be deferred because the thread calling + /// close(1) was also one of the ThreadPool threads + bool deferred_shutdown_initiated_; + /// Flag used to avoid multiple open() calls. bool opened_; @@ -144,10 +149,12 @@ namespace TAO /// The queue of pending servant requests (a.k.a. the "request queue"). TP_Queue queue_; - typedef ACE_Array <ACE_thread_t> Thread_Ids; + typedef ACE_Vector <ACE_thread_t> Thread_Ids; /// The list of ids for the threads launched by this task. Thread_Ids activated_threads_; + + enum { MAX_THREADPOOL_TASK_WORKER_THREADS = 50 }; }; } diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.inl b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.inl index d9c203f45ce..21dc662b5d7 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.inl +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.inl @@ -2,9 +2,6 @@ // // $Id$ -namespace { enum { MAX_THREADPOOL_TASK_WORKER_THREADS = 50 }; } -namespace { const ACE_thread_t default_thread_id = 0; } - TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE @@ -13,9 +10,10 @@ TAO::CSD::TP_Task::TP_Task() active_workers_(this->lock_), accepting_requests_(false), shutdown_initiated_(false), + deferred_shutdown_initiated_(false), opened_(false), num_threads_(0), - activated_threads_ ((size_t)MAX_THREADPOOL_TASK_WORKER_THREADS, default_thread_id) + activated_threads_ ((size_t)MAX_THREADPOOL_TASK_WORKER_THREADS) { } diff --git a/TAO/tao/Codeset/Codeset_Translator_Factory_T.cpp b/TAO/tao/Codeset/Codeset_Translator_Factory_T.cpp index 69f842bf574..83571c9d6bb 100644 --- a/TAO/tao/Codeset/Codeset_Translator_Factory_T.cpp +++ b/TAO/tao/Codeset/Codeset_Translator_Factory_T.cpp @@ -18,6 +18,7 @@ #include "tao/Codeset/Codeset_Translator_Factory_T.h" #include "tao/debug.h" #include "tao/CDR.h" +#include "ace/Log_Msg.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index a3204010c33..527378707c8 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -136,9 +136,7 @@ TAO_Connection_Handler::svc_i (void) // Let the transport know that it is used (void) this->transport ()->update_transport (); - result = - this->transport ()->handle_input (rh, - max_wait_time); + result = this->transport ()->handle_input (rh, max_wait_time); if (result == -1 && errno == ETIME) { diff --git a/TAO/tao/DiffServPolicy/Server_Network_Priority_Policy.cpp b/TAO/tao/DiffServPolicy/Server_Network_Priority_Policy.cpp index c779ac07c3a..5884dc4eb30 100644 --- a/TAO/tao/DiffServPolicy/Server_Network_Priority_Policy.cpp +++ b/TAO/tao/DiffServPolicy/Server_Network_Priority_Policy.cpp @@ -3,6 +3,7 @@ #include "tao/DiffServPolicy/Server_Network_Priority_Policy.h" #include "tao/SystemException.h" #include "tao/ORB_Constants.h" +#include "tao/CDR.h" ACE_RCSID (DiffServPolicy, Server_Network_Priority_Policy, diff --git a/TAO/tao/DynamicAny/DynAny_i.cpp b/TAO/tao/DynamicAny/DynAny_i.cpp index da9d1d66b6e..bce4d6ad6f6 100644 --- a/TAO/tao/DynamicAny/DynAny_i.cpp +++ b/TAO/tao/DynamicAny/DynAny_i.cpp @@ -1,12 +1,14 @@ // $Id$ +#include "tao/AnyTypeCode/TypeCode.h" #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/AnyTypeCode/AnyTypeCode_methods.h" -#include "tao/DynamicAny/DynAnyUtils_T.h" #include "tao/DynamicAny/DynAny_i.h" #include "tao/DynamicAny/DynAnyFactory.h" +#include "tao/DynamicAny/DynAnyUtils_T.h" + #include "tao/CDR.h" #include "ace/OS_NS_wchar.h" diff --git a/TAO/tao/DynamicAny/DynEnum_i.cpp b/TAO/tao/DynamicAny/DynEnum_i.cpp index 0c6be6d8473..ac01dd4f7bd 100644 --- a/TAO/tao/DynamicAny/DynEnum_i.cpp +++ b/TAO/tao/DynamicAny/DynEnum_i.cpp @@ -1,5 +1,6 @@ // $Id$ +#include "tao/AnyTypeCode/TypeCode.h" #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/AnyTypeCode/AnyTypeCode_methods.h" #include "tao/DynamicAny/DynEnum_i.h" diff --git a/TAO/tao/DynamicAny/DynUnion_i.cpp b/TAO/tao/DynamicAny/DynUnion_i.cpp index 2e32ed48a38..b777fb5618d 100644 --- a/TAO/tao/DynamicAny/DynUnion_i.cpp +++ b/TAO/tao/DynamicAny/DynUnion_i.cpp @@ -1,6 +1,7 @@ // $Id$ #include "tao/DynamicAny/DynUnion_i.h" +#include "tao/DynamicAny/DynEnum_i.h" #include "tao/DynamicAny/DynAnyFactory.h" #include "tao/DynamicAny/DynAnyUtils_T.h" diff --git a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp index b790000bba2..e70720eec1c 100644 --- a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp +++ b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp @@ -5,6 +5,7 @@ #include "tao/AnyTypeCode/Any_Impl.h" #include "tao/operation_details.h" #include "tao/SystemException.h" +#include "tao/CDR.h" ACE_RCSID (DynamicInterface, DII_Arguments_Converter_Impl, diff --git a/TAO/tao/DynamicInterface/DII_Invocation.h b/TAO/tao/DynamicInterface/DII_Invocation.h index 373d6058500..01b2dae15fe 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation.h +++ b/TAO/tao/DynamicInterface/DII_Invocation.h @@ -60,8 +60,8 @@ namespace TAO Invocation_Status remote_invocation (ACE_Time_Value *max_wait_time); virtual Invocation_Status handle_user_exception (TAO_InputCDR &cdr); - private: + private: CORBA::ExceptionList *excp_list_; /// Back pointer to the DII request that created us. @@ -89,10 +89,8 @@ namespace TAO Invocation_Status remote_invocation (ACE_Time_Value *max_wait_time); private: - /// Back pointer to the DII request that created us. CORBA::Request_ptr host_; - }; /** diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp index 744ff1a11f8..e04f890a971 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp +++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp @@ -9,7 +9,6 @@ #include "tao/ORB_Constants.h" #include "tao/Profile_Transport_Resolver.h" #include "tao/Transport.h" -#include "tao/Transport.h" #include "tao/GIOP_Message_Base.h" #include "tao/SystemException.h" #include "tao/operation_details.h" @@ -87,7 +86,17 @@ namespace TAO CORBA::COMPLETED_NO); } - r.transport ()->messaging_object ()->out_stream ().reset_byte_order ( + TAO_Transport* const transport = r.transport (); + + if (!transport) + { + // Way back, we failed to find a profile we could connect to. + // We've come this far only so we reach the interception points + // in case they can fix things. Time to bail.... + throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + } + + transport->messaging_object ()->out_stream ().reset_byte_order ( request_->_tao_byte_order ()); TAO::DII_Invocation synch (this->target_, @@ -194,7 +203,19 @@ namespace TAO CORBA::COMPLETED_NO); } - r.transport ()->messaging_object ()->out_stream ().reset_byte_order (request_->_tao_byte_order ()); + TAO_Transport* const transport = r.transport (); + + if (!transport) + { + // Way back, we failed to find a profile we could connect to. + // We've come this far only so we reach the interception points + // in case they can fix things. Time to bail.... + throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + } + + transport->messaging_object ()->out_stream ().reset_byte_order ( + request_->_tao_byte_order ()); + TAO::DII_Deferred_Invocation synch ( this->target_, r, @@ -202,8 +223,6 @@ namespace TAO this->rd_, this->request_); - r.transport ()->messaging_object ()->out_stream ().reset_byte_order (request_->_tao_byte_order ()); - Invocation_Status status = synch.remote_invocation (max_wait_time); if (status == TAO_INVOKE_RESTART) diff --git a/TAO/tao/GIOP_Message_Base.h b/TAO/tao/GIOP_Message_Base.h index c86d01a088c..701a0f110d6 100644 --- a/TAO/tao/GIOP_Message_Base.h +++ b/TAO/tao/GIOP_Message_Base.h @@ -22,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/Exception.h" #include "tao/Pluggable_Messaging_Utils.h" #include "tao/GIOP_Message_Generator_Parser_Impl.h" #include "tao/GIOP_Utils.h" diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 9a3a02f3448..67f73e5c00c 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -297,8 +297,7 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE h) int TAO_IIOP_Connection_Handler::handle_output (ACE_HANDLE handle) { - const int result = - this->handle_output_eh (handle, this); + int const result = this->handle_output_eh (handle, this); if (result == -1) { @@ -336,8 +335,7 @@ TAO_IIOP_Connection_Handler::handle_timeout (const ACE_Time_Value &, } int -TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) +TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) { ACE_ASSERT (0); return 0; @@ -376,8 +374,7 @@ TAO_IIOP_Connection_Handler::add_transport_to_cache (void) this->orb_core ()->lane_resources ().transport_cache (); // Idle the transport.. - return cache.cache_idle_transport (&prop, - this->transport ()); + return cache.cache_idle_transport (&prop, this->transport ()); } int @@ -385,7 +382,7 @@ TAO_IIOP_Connection_Handler::process_listen_point_list ( IIOP::ListenPointList &listen_list) { // Get the size of the list - const CORBA::ULong len = listen_list.length (); + CORBA::ULong const len = listen_list.length (); if (TAO_debug_level > 0 && len == 0) { @@ -426,11 +423,8 @@ TAO_IIOP_Connection_Handler::process_listen_point_list ( // The property for this handler has changed. Recache the // handler with this property - int retval = - this->transport ()->recache_transport (&prop); - - if (retval == -1) - return retval; + if (this->transport ()->recache_transport (&prop) == -1) + return -1; // Make the handler idle and ready for use this->transport ()->make_idle (); @@ -517,8 +511,7 @@ TAO_IIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean set_network_prio if (tph != 0) { - CORBA::Long codepoint = - tph->get_dscp_codepoint (); + CORBA::Long codepoint = tph->get_dscp_codepoint (); tos = static_cast<int> (codepoint) << 2; this->set_tos (tos); diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index ff228543157..f7c4187c8fe 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -168,7 +168,7 @@ TAO_IIOP_Connector::set_validate_endpoint (TAO_Endpoint *endpoint) if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) IIOP connection failed.\n") + ACE_TEXT ("TAO (%P|%t) - IIOP connection failed.\n") ACE_TEXT (" This is most likely ") ACE_TEXT ("due to a hostname lookup ") ACE_TEXT ("failure.\n"))); @@ -682,20 +682,18 @@ TAO_IIOP_Connector::check_prefix (const char *endpoint) static const char *protocol[] = { "iiop", "iioploc" }; - const size_t slot = ACE_OS::strchr (endpoint, ':') - endpoint; + size_t const slot = ACE_OS::strchr (endpoint, ':') - endpoint; if (slot == 0) // an empty string is valid for corbaloc. return 0; - const size_t len0 = ACE_OS::strlen (protocol[0]); - const size_t len1 = ACE_OS::strlen (protocol[1]); + size_t const len0 = ACE_OS::strlen (protocol[0]); + size_t const len1 = ACE_OS::strlen (protocol[1]); // Check for the proper prefix in the IOR. If the proper prefix // isn't in the IOR then it is not an IOR we can use. - if (slot == len0 - && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0) + if (slot == len0 && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0) return 0; - else if (slot == len1 - && ACE_OS::strncasecmp (endpoint, protocol[1], len1) == 0) + else if (slot == len1 && ACE_OS::strncasecmp (endpoint, protocol[1], len1) == 0) return 0; return -1; diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index a012e078930..45e441d8f87 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -75,7 +75,7 @@ TAO_IIOP_Transport::send (iovec *iov, int iovcnt, { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - IIOP_Transport[%d]::send, ") - ACE_TEXT ("send failure - %m (errno: %d)\n"), + ACE_TEXT ("send failure (errno: %d) - %m\n"), this->id (), errno)); } } @@ -174,11 +174,8 @@ TAO_IIOP_Transport::recv (char *buf, // Do not print the error message if it is a timeout, which could // occur in thread-per-connection. - if (n == -1 && - TAO_debug_level > 4 && - errno != ETIME) + if (n == -1 && TAO_debug_level > 4 && errno != ETIME) { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - IIOP_Transport[%d]::recv, ") ACE_TEXT ("read failure - %m errno %d\n"), @@ -211,12 +208,10 @@ int TAO_IIOP_Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { - if (this->ws_->sending_request (orb_core, - message_semantics) == -1) - + if (this->ws_->sending_request (orb_core, message_semantics) == -1) return -1; if (this->send_message (stream, @@ -233,7 +228,7 @@ TAO_IIOP_Transport::send_request (TAO_Stub *stub, int TAO_IIOP_Transport::send_message (TAO_OutputCDR &stream, TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { // Format the message in the stream first @@ -266,7 +261,7 @@ TAO_IIOP_Transport::send_message (TAO_OutputCDR &stream, int TAO_IIOP_Transport::send_message_shared ( TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time) { @@ -415,8 +410,7 @@ TAO_IIOP_Transport::get_listen_point ( // Get the local address of the connection ACE_INET_Addr local_addr; - if (this->connection_handler_->peer ().get_local_addr (local_addr) - == -1) + if (this->connection_handler_->peer ().get_local_addr (local_addr) == -1) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("TAO (%P|%t) - IIOP_Transport::get_listen_point, ") diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index 84cd04b0710..25485689663 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -91,7 +91,7 @@ protected: virtual ssize_t recv (char *buf, size_t len, const ACE_Time_Value *s = 0); virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -109,12 +109,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); virtual int generate_request_header (TAO_Operation_Details &opdetails, diff --git a/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp b/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp index d6d3c49e740..e75ceca9d99 100644 --- a/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp +++ b/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp @@ -7,6 +7,7 @@ #include "tao/IORManipulation/IORManip_Loader.h" #include "tao/IIOP_Profile.h" #include "tao/MProfile.h" +#include "tao/CDR.h" ACE_RCSID (IORManip_IIOP_Filter, IORManip_IIOP_Filter, "$Id$") diff --git a/TAO/tao/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp index 614e4ef86de..887c8735382 100644 --- a/TAO/tao/IORManipulation/IORManipulation.cpp +++ b/TAO/tao/IORManipulation/IORManipulation.cpp @@ -212,16 +212,14 @@ TAO_IOR_Manipulation_impl::remove_profiles ( CORBA::Boolean TAO_IOR_Manipulation_impl::set_property ( TAO_IOP::TAO_IOR_Property_ptr prop, - CORBA::Object_ptr group - ) + CORBA::Object_ptr group) { // make sure we have some profiles if (group->_stubobj ()->base_profiles ().profile_count () == 0) throw TAO_IOP::Invalid_IOR (); // Call the implementation object to - return prop->set_property (group - ); + return prop->set_property (group); } //@@ note awkward argument order @@ -229,8 +227,7 @@ CORBA::Boolean TAO_IOR_Manipulation_impl::set_primary ( TAO_IOP::TAO_IOR_Property_ptr prop, CORBA::Object_ptr new_primary, - CORBA::Object_ptr group - ) + CORBA::Object_ptr group) { // make sure we have some profiles in GROUP if (group->_stubobj ()->base_profiles ().profile_count () == 0) @@ -242,17 +239,13 @@ TAO_IOR_Manipulation_impl::set_primary ( throw TAO_IOP::MultiProfileList ();*/ // Call the callback object to do the rest of the processing. - return prop->set_primary (new_primary, - group - ); + return prop->set_primary (new_primary, group); } CORBA::Object_ptr TAO_IOR_Manipulation_impl::get_primary ( TAO_IOP::TAO_IOR_Property_ptr prop, - CORBA::Object_ptr group - - ) + CORBA::Object_ptr group) { // make sure we have some profiles in IOR if (group->_stubobj ()->base_profiles ().profile_count () == 0) @@ -262,8 +255,7 @@ TAO_IOR_Manipulation_impl::get_primary ( // run-time (if it does not crash). Any idea about what is going on // here? - return prop->get_primary (group - ); + return prop->get_primary (group); } CORBA::Boolean @@ -285,11 +277,10 @@ TAO_IOR_Manipulation_impl:: remove_primary_tag ( CORBA::ULong TAO_IOR_Manipulation_impl::is_in_ior ( CORBA::Object_ptr ior1, - CORBA::Object_ptr ior2 - ) + CORBA::Object_ptr ior2) { CORBA::ULong count = 0; - TAO_Profile *pfile1, *pfile2; + TAO_Profile *pfile1 = 0, *pfile2 = 0; auto_ptr<TAO_MProfile> tmp_pfiles1 (ior1->_stubobj ()->make_profiles ()); auto_ptr<TAO_MProfile> tmp_pfiles2 (ior2->_stubobj ()->make_profiles ()); @@ -300,7 +291,7 @@ TAO_IOR_Manipulation_impl::is_in_ior ( while ((pfile2 = tmp_pfiles2->get_next ()) > 0) { if (pfile1->is_equivalent (pfile2)) - count++; + ++count; } } diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index 8375055e311..0674e6e090d 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -67,8 +67,7 @@ namespace TAO // Initial state TAO::Invocation_Status status = TAO_INVOKE_START; - while (status == TAO_INVOKE_START || - status == TAO_INVOKE_RESTART) + while (status == TAO_INVOKE_START || status == TAO_INVOKE_RESTART) { // Default we go to remote Collocation_Strategy strat = TAO_CS_REMOTE_STRATEGY; @@ -232,7 +231,7 @@ namespace TAO (void) this->set_response_flags (stub, details); - CORBA::Octet rflags = details.response_flags (); + CORBA::Octet const rflags = details.response_flags (); bool const block_connect = rflags != static_cast<CORBA::Octet> (Messaging::SYNC_NONE) && rflags != static_cast<CORBA::Octet> (TAO::SYNC_DELAYED_BUFFERING); @@ -254,25 +253,30 @@ namespace TAO ACE_TEXT ("max wait time consumed during transport resolution\n"))); } - // Update the request id now that we have a transport - details.request_id (resolver.transport ()->tms ()->request_id ()); - - if (this->type_ == TAO_ONEWAY_INVOCATION) + if (resolver.transport ()) { - return this->invoke_oneway (details, - effective_target, - resolver, - max_wait_time); + details.request_id (resolver.transport ()->tms ()->request_id ()); } - else if (this->type_ == TAO_TWOWAY_INVOCATION) + + switch (this->type_) { - return this->invoke_twoway (details, - effective_target, - resolver, - max_wait_time); - } + case TAO_ONEWAY_INVOCATION: + { + return this->invoke_oneway (details, + effective_target, + resolver, + max_wait_time); + } + case TAO_TWOWAY_INVOCATION: + { + return this->invoke_twoway (details, + effective_target, + resolver, + max_wait_time); + } + } return TAO_INVOKE_FAILURE; } @@ -370,8 +374,6 @@ namespace TAO TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE, errno), CORBA::COMPLETED_NO); - - return; } } // End namespace TAO diff --git a/TAO/tao/Invocation_Base.h b/TAO/tao/Invocation_Base.h index ff1428ab04d..625601957bc 100644 --- a/TAO/tao/Invocation_Base.h +++ b/TAO/tao/Invocation_Base.h @@ -25,6 +25,7 @@ #include "tao/Invocation_Utils.h" #if TAO_HAS_INTERCEPTORS == 1 +#include "tao/Exception.h" #include "tao/PI_ForwardC.h" #include "tao/ClientRequestInterceptor_Adapter.h" #endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index 2031c2dbff1..1b9885e5ef6 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -74,9 +74,13 @@ TAO_Default_Endpoint_Selector::select_endpoint (TAO::Profile_Transport_Resolver } while (r->stub ()->next_profile_retry () != 0); - // If we get here, we completely failed to find an endpoint selector - // that we know how to use, so throw an exception. - throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + // If we get here, we completely failed to find an endpoint + // that we know how to use. We used to throw an exception + // but that would prevent any request interception points + // being called. They may know how to fix the problem so + // we wait to throw the exception in + // Synch_Twoway_Invocation::remote_twoway and + // Synch_Oneway_Invocation::remote_oneway instead. } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp index 93f7aade719..db4e9fa6831 100644 --- a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp +++ b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp @@ -22,8 +22,7 @@ TAO_Leader_Follower_Flushing_Strategy::schedule_output (TAO_Transport *transport int TAO_Leader_Follower_Flushing_Strategy::cancel_output ( - TAO_Transport *transport - ) + TAO_Transport *transport) { return transport->cancel_output_i (); } @@ -32,8 +31,7 @@ int TAO_Leader_Follower_Flushing_Strategy::flush_message ( TAO_Transport *transport, TAO_Queued_Message *msg, - ACE_Time_Value *max_wait_time - ) + ACE_Time_Value *max_wait_time) { TAO_Leader_Follower &leader_follower = transport->orb_core ()->leader_follower (); @@ -42,8 +40,7 @@ TAO_Leader_Follower_Flushing_Strategy::flush_message ( int TAO_Leader_Follower_Flushing_Strategy::flush_transport ( - TAO_Transport *transport - ) + TAO_Transport *transport) { // @todo This is not the right way to do this.... diff --git a/TAO/tao/MMAP_Allocator.h b/TAO/tao/MMAP_Allocator.h index 08f3295ecfd..083ad54382d 100644 --- a/TAO/tao/MMAP_Allocator.h +++ b/TAO/tao/MMAP_Allocator.h @@ -33,7 +33,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // An ACE_Lite_MMAP_Memory_Pool is used since sync()ing is not // needed. All memory allocated by the TAO_MMAP_Allocator is meant // for strictly transient data, not persistent. -typedef ACE_Allocator_Adapter <ACE_Malloc<ACE_LITE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> > TAO_MMAP_Allocator_Base; +typedef ACE_Allocator_Adapter <ACE_Malloc<ACE_LITE_MMAP_MEMORY_POOL, TAO_SYNCH_MUTEX> > TAO_MMAP_Allocator_Base; /** * @class TAO_MMAP_Allocator diff --git a/TAO/tao/Messaging/AMH_Response_Handler.h b/TAO/tao/Messaging/AMH_Response_Handler.h index 7bcd45b886e..74b4d136156 100644 --- a/TAO/tao/Messaging/AMH_Response_Handler.h +++ b/TAO/tao/Messaging/AMH_Response_Handler.h @@ -24,6 +24,7 @@ #include "ace/Synch_Traits.h" #include "ace/Thread_Mutex.h" #include "ace/Null_Mutex.h" +#include "tao/Exception.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -182,7 +183,7 @@ private: // The lighter-weight form (using a state variable /// Mutex to ensure the AMH-RH method call is thread-safe. - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; /// Allocator used to allocate this object. If zero then we are allocated /// from the heap diff --git a/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp index 144ff7ed9f4..2bbecec5547 100644 --- a/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp +++ b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp @@ -4,6 +4,7 @@ #include "tao/SystemException.h" #include "tao/Pluggable_Messaging_Utils.h" #include "tao/Reply_Dispatcher.h" +#include "tao/CDR.h" ACE_RCSID (Messaging, AMI_Arguments_Converter_Impl, diff --git a/TAO/tao/Messaging/Asynch_Invocation.cpp b/TAO/tao/Messaging/Asynch_Invocation.cpp index ef635284df1..43f8e3fdee1 100644 --- a/TAO/tao/Messaging/Asynch_Invocation.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation.cpp @@ -41,12 +41,6 @@ namespace TAO Invocation_Status Asynch_Remote_Invocation::remote_invocation (ACE_Time_Value *max_wait_time) { - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - - TAO_OutputCDR & cdr = - this->resolver_.transport ()->messaging_object ()->out_stream (); - Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 @@ -61,6 +55,18 @@ namespace TAO try { #endif /* TAO_HAS_INTERCEPTORS */ + TAO_Transport* const transport = this->resolver_.transport (); + + if (!transport) + { + // Way back, we failed to find a profile we could connect to. + // We've come this far only so we reach the interception points + // in case they can fix things. Time to bail.... + throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + } + + TAO_OutputCDR & cdr = + this->resolver_.transport ()->messaging_object ()->out_stream (); // Oneway semantics. See comments for below send_message() // call. @@ -69,7 +75,7 @@ namespace TAO TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); @@ -78,7 +84,7 @@ namespace TAO TAO_Bind_Dispatcher_Guard dispatch_guard ( this->details_.request_id (), this->safe_rd_.get (), - this->resolver_.transport ()->tms ()); + transport->tms ()); // Now that we have bound the reply dispatcher to the map, just // loose ownership of the reply dispatcher. @@ -132,7 +138,7 @@ namespace TAO // NOTE: Not sure how things are handles with exclusive muxed // strategy. - if (this->resolver_.transport ()->idle_after_send ()) + if (transport->idle_after_send ()) (void) this->resolver_.transport_released (); #if TAO_HAS_INTERCEPTORS == 1 diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp index b52785566d8..aa6216f76ba 100644 --- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp @@ -170,11 +170,9 @@ namespace TAO CORBA::COMPLETED_NO); } - if (this->safe_rd_.get ()) + if (this->safe_rd_.get () && r.transport ()) { - // Cache the transport in the reply dispatcher this->safe_rd_->transport (r.transport ()); - // AMI Timeout Handling Begin ACE_Time_Value tmp; diff --git a/TAO/tao/Messaging/ExceptionHolder_i.cpp b/TAO/tao/Messaging/ExceptionHolder_i.cpp index 07bf028880e..88c7f85c6f2 100644 --- a/TAO/tao/Messaging/ExceptionHolder_i.cpp +++ b/TAO/tao/Messaging/ExceptionHolder_i.cpp @@ -9,6 +9,7 @@ ACE_RCSID (Messaging, #include "tao/Messaging/Messaging.h" #include "tao/Exception_Data.h" +#include "tao/CDR.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 46222b87a7d..534b92a238a 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1,4 +1,4 @@ -// "$Id$" + // "$Id$" #include "tao/ORB.h" @@ -231,12 +231,12 @@ CORBA::ORB::work_pending (ACE_Time_Value &tv) int const result = this->orb_core_->reactor ()->work_pending (tv); if (result == 0 || (result == -1 && errno == ETIME)) - return 0; + return false; if (result == -1) throw ::CORBA::INTERNAL (); - return 1; + return true; } CORBA::Boolean @@ -247,12 +247,12 @@ CORBA::ORB::work_pending (void) const int result = this->orb_core_->reactor ()->work_pending (); if (result == 0) - return 0; + return false; if (result == -1) throw ::CORBA::INTERNAL (); - return 1; + return true; } #if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index 5a5cbe0d53f..5201a3b506c 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -396,7 +396,7 @@ namespace CORBA * * If this function is called with @a tv value, client threads * making invocations will continue their operations. When the - * operation timesout and returns, any invocations showing up on + * operation times out and returns, any invocations showing up on * the server will be buffered by TCP. **/ void run (ACE_Time_Value *tv); diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index c1a4a0778a3..b3c16fc8706 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -45,10 +45,16 @@ namespace PortableInterceptor TAO::ORB::init_orb_globals (); } +#if defined (ACE_VXWORKS) && defined (ACE_HAS_TSS_EMULATION) + bool const lookup = false; +#else + bool const lookup = true; +#endif + // If not, look it up. TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry_ = ACE_Dynamic_Service<TAO::ORBInitializer_Registry_Adapter>::instance - ("ORBInitializer_Registry", true); // only look in the local repo + ("ORBInitializer_Registry", lookup); // only look in the local repo #if !defined (TAO_AS_STATIC_LIBS) if (orbinitializer_registry_ == 0) @@ -71,7 +77,7 @@ namespace PortableInterceptor else { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("TAO (%P|%t) %p\n"), ACE_TEXT ("ERROR: ORBInitializer Registry unable to find the ") ACE_TEXT ("ORBInitializer Registry instance"))); diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index ea9a870bd25..d6e9033b9c6 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -2104,15 +2104,11 @@ TAO_ORB_Core::run (ACE_Time_Value *tv, int perform_work) // Every time we perform an interation we have to become the // leader again, because it is possible that a client has // acquired the leader role... - TAO_Leader_Follower &leader_follower = - this->leader_follower (); + TAO_Leader_Follower &leader_follower = this->leader_follower (); + TAO_LF_Strategy &lf_strategy = this->lf_strategy (); - TAO_LF_Strategy &lf_strategy = - this->lf_strategy (); + TAO_LF_Event_Loop_Thread_Helper helper (leader_follower, lf_strategy, tv); - TAO_LF_Event_Loop_Thread_Helper helper (leader_follower, - lf_strategy, - tv); result = helper.event_loop_return (); if (result != 0) { diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp index d670c3ab051..d49005fa05b 100644 --- a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp @@ -33,12 +33,10 @@ namespace TAO int ORT_Adapter_Factory_Impl::Initializer (void) { - TAO_Root_POA::ort_adapter_factory_name ("Concrete_ORT_Adapter_Factory" - ); + TAO_Root_POA::ort_adapter_factory_name ("Concrete_ORT_Adapter_Factory"); return ACE_Service_Config::process_directive ( - ace_svc_desc_ORT_Adapter_Factory_Impl - ); + ace_svc_desc_ORT_Adapter_Factory_Impl); } } diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h index 397addb069c..b149e24a073 100644 --- a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h @@ -61,7 +61,6 @@ TAO_END_VERSIONED_NAMESPACE_DECL ACE_STATIC_SVC_DECLARE (ORT_Adapter_Factory_Impl) ACE_FACTORY_DECLARE (TAO_ORT, ORT_Adapter_Factory_Impl) - #define TAO_OBJREF_TEMPLATE_SAFE_INCLUDE #include "tao/ObjRefTemplate/ObjectReferenceTemplateC.h" #undef TAO_OBJREF_TEMPLATE_SAFE_INCLUDE diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp index 78b973c67fb..6dffcaa45b2 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp @@ -60,8 +60,7 @@ namespace TAO CORBA::Object_ptr ObjectReferenceTemplate::make_object ( const char *, - const PortableInterceptor::ObjectId & - ) + const PortableInterceptor::ObjectId &) { if (CORBA::is_nil (this->poa_.in ())) throw ::CORBA::BAD_INV_ORDER (); diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index 4a9f50341d7..330c87079d6 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -208,7 +208,7 @@ CORBA::Object::_is_a (const char *type_id) { TAO_OBJECT_IOR_EVALUATE_RETURN; - // NOTE: if istub->type_id is nonzero and we have local knowledge of + // NOTE: if _stub->type_id is nonzero and we have local knowledge of // it, we can answer this question without a costly remote call. // // That "local knowledge" could come from stubs or skeletons linked diff --git a/TAO/tao/PI/PI.cpp b/TAO/tao/PI/PI.cpp index 11abf6d283e..54b9891e22d 100644 --- a/TAO/tao/PI/PI.cpp +++ b/TAO/tao/PI/PI.cpp @@ -39,7 +39,6 @@ TAO_PI_Init::Initializer (void) try { /// Register the PI ORBInitializer. - ACE_NEW_THROW_EX (temp_orb_initializer, TAO_PI_ORBInitializer, CORBA::NO_MEMORY ( @@ -50,8 +49,7 @@ TAO_PI_Init::Initializer (void) orb_initializer = temp_orb_initializer; - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ); + PortableInterceptor::register_orb_initializer (orb_initializer.in ()); } catch (const ::CORBA::Exception& ex) { diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp index f066362ceba..040d3a55be5 100644 --- a/TAO/tao/PolicyC.cpp +++ b/TAO/tao/PolicyC.cpp @@ -31,6 +31,7 @@ #include "tao/PolicyC.h" #include "tao/CDR.h" +#include "tao/SystemException.h" #include "tao/Invocation_Adapter.h" #include "tao/Object_T.h" #include "tao/Basic_Arguments.h" diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index d9f2cd10b0f..eeeaea055d4 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -319,9 +319,37 @@ TAO_Root_POA::~TAO_Root_POA (void) void TAO_Root_POA::complete_destruction_i (void) { + bool doing_complete_destruction = + this->waiting_destruction_ != 0; + // No longer awaiting destruction. this->waiting_destruction_ = 0; + PortableServer::POA_var poa; + TAO::ORT_Array my_array_obj_ref_template; + TAO::ORT_Adapter *ort_adapter = 0; + if (doing_complete_destruction) + { + ort_adapter = + this->ORT_adapter_i (); + + // In case no ORT library is linked we get zero. + if (ort_adapter != 0) + { + // Get the ObjectReferenceTemplate. + PortableInterceptor::ObjectReferenceTemplate * const ort = + ort_adapter->get_adapter_template (); + + // Add it to the sequence of object reference templates, we + // just notify for ourselves that we are now non_existent, + // our childs will do it for themselves. + my_array_obj_ref_template.size (1); + my_array_obj_ref_template[0] = ort; + } + + poa = PortableServer::POA::_duplicate (this); + } + // Remove POA from the POAManager. int result = this->poa_manager_.remove_poa (this); @@ -361,6 +389,26 @@ TAO_Root_POA::complete_destruction_i (void) } ::CORBA::release (this); + + if (doing_complete_destruction) + { + this->adapter_state_ = PortableInterceptor::NON_EXISTENT; + + this->adapter_state_changed (my_array_obj_ref_template, + this->adapter_state_); + + if (ort_adapter != 0) + { + ort_adapter->release (my_array_obj_ref_template[0]); + + TAO::ORT_Adapter_Factory *ort_factory = + this->ORT_adapter_factory (); + + ort_factory->destroy (ort_adapter); + + this->ort_adapter_ = 0; + } + } } #if ! defined (CORBA_E_MICRO) diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp index 9e842fe05f2..e42ac16ce45 100644 --- a/TAO/tao/Profile_Transport_Resolver.cpp +++ b/TAO/tao/Profile_Transport_Resolver.cpp @@ -89,7 +89,10 @@ namespace TAO if (this->transport_.get () == 0) { - throw ::CORBA::INTERNAL (); + // No useable endpoint could be found. We will not + // be able to send the message. Wait to throw an exception until + // after the send_request interception point has been called. + return; } TAO_GIOP_Message_Version const & version = this->profile_->version (); diff --git a/TAO/tao/Queued_Data.cpp b/TAO/tao/Queued_Data.cpp index cad8076267d..6bd204c351c 100644 --- a/TAO/tao/Queued_Data.cpp +++ b/TAO/tao/Queued_Data.cpp @@ -4,12 +4,10 @@ #include "ace/Log_Msg.h" #include "ace/Malloc_Base.h" - #if !defined (__ACE_INLINE__) # include "tao/Queued_Data.inl" #endif /* __ACE_INLINE__ */ - ACE_RCSID (tao, Queued_Data, "$Id$") diff --git a/TAO/tao/Queued_Message.cpp b/TAO/tao/Queued_Message.cpp index 19cba1406a6..1f83185fa98 100644 --- a/TAO/tao/Queued_Message.cpp +++ b/TAO/tao/Queued_Message.cpp @@ -2,11 +2,14 @@ #include "tao/Queued_Message.h" +#if !defined (__ACE_INLINE__) +# include "tao/Queued_Message.inl" +#endif /* __ACE_INLINE__ */ + ACE_RCSID (tao, Queued_Message, "$Id$") - TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Queued_Message::TAO_Queued_Message (TAO_ORB_Core *oc, @@ -24,18 +27,6 @@ TAO_Queued_Message::~TAO_Queued_Message (void) { } -TAO_Queued_Message * -TAO_Queued_Message::next (void) const -{ - return this->next_; -} - -TAO_Queued_Message * -TAO_Queued_Message::prev (void) const -{ - return this->prev_; -} - void TAO_Queued_Message::remove_from_list (TAO_Queued_Message *&head, TAO_Queued_Message *&tail) diff --git a/TAO/tao/Queued_Message.h b/TAO/tao/Queued_Message.h index ee301886387..ff00277cbb8 100644 --- a/TAO/tao/Queued_Message.h +++ b/TAO/tao/Queued_Message.h @@ -231,6 +231,11 @@ private: TAO_END_VERSIONED_NAMESPACE_DECL +#if defined (__ACE_INLINE__) +# include "tao/Queued_Message.inl" +#endif /* __ACE_INLINE__ */ + + #include /**/ "ace/post.h" #endif /* TAO_QUEUED_MESSAGE_H */ diff --git a/TAO/tao/Queued_Message.inl b/TAO/tao/Queued_Message.inl new file mode 100644 index 00000000000..43ab83bc0af --- /dev/null +++ b/TAO/tao/Queued_Message.inl @@ -0,0 +1,17 @@ +// $Id$ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE TAO_Queued_Message * +TAO_Queued_Message::next (void) const +{ + return this->next_; +} + +ACE_INLINE TAO_Queued_Message * +TAO_Queued_Message::prev (void) const +{ + return this->prev_; +} + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTCORBA/RT_ORB.cpp b/TAO/tao/RTCORBA/RT_ORB.cpp index a59c65b7de8..625035b99b5 100644 --- a/TAO/tao/RTCORBA/RT_ORB.cpp +++ b/TAO/tao/RTCORBA/RT_ORB.cpp @@ -21,11 +21,13 @@ ACE_RCSID(RTCORBA, TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_RT_ORB::TAO_RT_ORB (TAO_ORB_Core *orb_core, - ACE_Time_Value const &dynamic_thread_idle_timeout) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) : orb_core_ (orb_core), mutex_mgr_ (), tp_manager_ (0), - dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout) + lifespan_ (lifespan), + dynamic_thread_time_ (dynamic_thread_time) { TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager = &this->orb_core_->thread_lane_resources_manager (); @@ -330,8 +332,8 @@ TAO_RT_ORB::create_threadpool (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - this->dynamic_thread_idle_timeout_ - ); + this->lifespan_, + this->dynamic_thread_time_); } RTCORBA::ThreadpoolId @@ -340,8 +342,7 @@ TAO_RT_ORB::create_threadpool_with_lanes (CORBA::ULong stacksize, CORBA::Boolean allow_borrowing, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, - CORBA::ULong max_request_buffer_size - ) + CORBA::ULong max_request_buffer_size) { return this->tp_manager_->create_threadpool_with_lanes (stacksize, lanes, @@ -349,8 +350,8 @@ TAO_RT_ORB::create_threadpool_with_lanes (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - this->dynamic_thread_idle_timeout_ - ); + this->lifespan_, + this->dynamic_thread_time_); } void @@ -361,8 +362,7 @@ TAO_RT_ORB::destroy_threadpool (RTCORBA::ThreadpoolId threadpool) RTCORBA::PriorityModelPolicy_ptr TAO_RT_ORB::create_priority_model_policy (RTCORBA::PriorityModel priority_model, - RTCORBA::Priority server_priority - ) + RTCORBA::Priority server_priority) { TAO_PriorityModelPolicy *tmp = 0; ACE_NEW_THROW_EX (tmp, @@ -423,8 +423,7 @@ TAO_RT_ORB::create_server_protocol_policy (const RTCORBA::ProtocolList & protoco } RTCORBA::ClientProtocolPolicy_ptr -TAO_RT_ORB::create_client_protocol_policy (const RTCORBA::ProtocolList & protocols - ) +TAO_RT_ORB::create_client_protocol_policy (const RTCORBA::ProtocolList & protocols) { TAO_ClientProtocolPolicy *tmp = 0; ACE_NEW_THROW_EX (tmp, diff --git a/TAO/tao/RTCORBA/RT_ORB.h b/TAO/tao/RTCORBA/RT_ORB.h index 41cddf546ec..d5a42309038 100644 --- a/TAO/tao/RTCORBA/RT_ORB.h +++ b/TAO/tao/RTCORBA/RT_ORB.h @@ -22,6 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/RTCORBA/RTCORBA_includeC.h" +#include "tao/RTCORBA/RT_ORBInitializer.h" #include "tao/LocalObject.h" #include "ace/Hash_Map_Manager_T.h" @@ -46,7 +47,6 @@ class TAO_Thread_Pool_Manager; * @brief Manages the names of named and unnamed RT Mutexes * */ - class TAO_RTCORBA_Export TAO_Named_RT_Mutex_Manager { @@ -97,7 +97,9 @@ class TAO_RTCORBA_Export TAO_RT_ORB public: /// Constructor. - TAO_RT_ORB (TAO_ORB_Core *orb_core, ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORB (TAO_ORB_Core *orb_core, + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /** * Create a new mutex. Mutexes returned by this method @@ -268,8 +270,11 @@ protected: /// Thread Pool Manager TAO_Thread_Pool_Manager *tp_manager_; - /// Dynamic thread idle timeout - ACE_Time_Value const dynamic_thread_idle_timeout_; + /// Dynamic thread lifespan policy + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan_; + + /// Dynamic thread run time + ACE_Time_Value const dynamic_thread_time_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp index c10742988a1..34499ba7575 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp @@ -51,13 +51,15 @@ TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (int priority_mapping_type, int ace_sched_policy, long sched_policy, long scope_policy, - ACE_Time_Value const &dynamic_thread_idle_timeout) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) : priority_mapping_type_ (priority_mapping_type), network_priority_mapping_type_ (network_priority_mapping_type), ace_sched_policy_ (ace_sched_policy), sched_policy_ (sched_policy), scope_policy_ (scope_policy), - dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout) + lifespan_ (lifespan), + dynamic_thread_time_ (dynamic_thread_time) { } @@ -175,7 +177,8 @@ TAO_RT_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info) CORBA::Object_ptr rt_orb = CORBA::Object::_nil (); ACE_NEW_THROW_EX (rt_orb, TAO_RT_ORB (tao_info->orb_core (), - dynamic_thread_idle_timeout_), + lifespan_, + dynamic_thread_time_), CORBA::NO_MEMORY ( CORBA::SystemException::_tao_minor_code ( TAO::VMCID, diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.h b/TAO/tao/RTCORBA/RT_ORBInitializer.h index ce6c3cb9d1b..d0c1ecfc8a8 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.h +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.h @@ -57,12 +57,29 @@ public: TAO_NETWORK_PRIORITY_MAPPING_LINEAR }; + /* + * Lifespan of the dynamic threads + * TAO_RTCORBA_DT_INFINITIVE When the Dynamic Thread is created it will run + * forever + * TAO_RTCORBA_DT_IDLE When the Dynamic Thread is created it will run until + * it has been idle for the specified amount of time + * TAO_RTCORBA_DT_FIXED When the Dynamic Thread is created it will run for + * the specified fix amount of time + */ + enum TAO_RTCORBA_DT_LifeSpan + { + TAO_RTCORBA_DT_INFINITIVE, + TAO_RTCORBA_DT_IDLE, + TAO_RTCORBA_DT_FIXED + }; + TAO_RT_ORBInitializer (int priority_mapping_type, int network_priority_mapping_type, int ace_sched_policy, long sched_policy, long scope_policy, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info); @@ -115,14 +132,16 @@ private: */ long const scope_policy_; - /// Dynamic thread idle timeout + /// Dynamic thread lifespan policy + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan_; + + /// Dynamic thread time /** * When using thread pool a certain number of dynamic threads can be created. - * By default these threads are created when needed but never end, when this - * timeout is specified the threads end themselves at the moment they - * have not been serving any requests for the specified amount of time + * By default these threads are created when needed but never end. Optionally + * a time can be specified */ - ACE_Time_Value const dynamic_thread_idle_timeout_; + ACE_Time_Value const dynamic_thread_time_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp index 12a87c1646e..e7f2844d531 100644 --- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp +++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp @@ -43,7 +43,8 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[]) long sched_policy = THR_SCHED_DEFAULT; long scope_policy = THR_SCOPE_PROCESS; int curarg = 0; - ACE_Time_Value dynamic_thread_idle_timeout; + ACE_Time_Value dynamic_thread_time; + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan = TAO_RT_ORBInitializer::TAO_RTCORBA_DT_INFINITIVE; ACE_Arg_Shifter arg_shifter (argc, argv); @@ -135,7 +136,17 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[]) { const ACE_TCHAR *name = current_arg; int timeout = ACE_OS::atoi (name); - dynamic_thread_idle_timeout = ACE_Time_Value (0, timeout); + dynamic_thread_time = ACE_Time_Value (0, timeout); + lifespan = TAO_RT_ORBInitializer::TAO_RTCORBA_DT_IDLE; + arg_shifter.consume_arg (); + } + else if (0 != (current_arg = arg_shifter.get_the_parameter + (ACE_TEXT("-RTORBDynamicThreadRunTime")))) + { + const ACE_TCHAR *name = current_arg; + int timeout = ACE_OS::atoi (name); + dynamic_thread_time = ACE_Time_Value (0, timeout); + lifespan = TAO_RT_ORBInitializer::TAO_RTCORBA_DT_FIXED; arg_shifter.consume_arg (); } else @@ -164,7 +175,8 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[]) ace_sched_policy, sched_policy, scope_policy, - dynamic_thread_idle_timeout), + lifespan, + dynamic_thread_time), CORBA::NO_MEMORY ( CORBA::SystemException::_tao_minor_code ( TAO::VMCID, diff --git a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp index 3035e8c84c4..7498ef44d68 100644 --- a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp +++ b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp @@ -64,11 +64,11 @@ TAO_RT_Thread_Lane_Resources_Manager::open_default_resources (void) void TAO_RT_Thread_Lane_Resources_Manager::finalize (void) { - // Finalize default resources. - this->default_lane_resources_->finalize (); - // Finalize resources managed by the thread-pool manager. this->tp_manager_->finalize (); + + // Finalize default resources. + this->default_lane_resources_->finalize (); } void diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index 6622e014bad..74305c0da70 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -105,31 +105,48 @@ TAO_Dynamic_Thread_Pool_Threads::run (TAO_ORB_Core &orb_core) { CORBA::ORB_ptr orb = orb_core.orb (); - if (this->lane_.dynamic_thread_idle_timeout () == ACE_Time_Value::zero) - { - // No timeout specified, run the ORB until it shutdowns - orb->run (); - } - else + switch (this->lane_.lifespan ()) + { + case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_FIXED : + { + ACE_Time_Value tv_run (this->lane_.dynamic_thread_time ()); + orb->run (tv_run); + } + break; + case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_IDLE : + { + // A timeout is specified, run the ORB in an idle loop, if we + // don't handle any operations for the given timeout we just + // exit the loop and this thread ends itself. + ACE_Time_Value tv (this->lane_.dynamic_thread_time ()); + while (!orb_core.has_shutdown () && orb->work_pending (tv)) + { + // Run the ORB for the specified timeout, this prevents looping + // between work_pending/handle_events + tv = this->lane_.dynamic_thread_time (); + orb->run (tv); + // Reset the idle timeout + tv = this->lane_.dynamic_thread_time (); + } + } + break; + case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_INFINITIVE : + { + // No timeout specified, run the ORB until it shutdowns + orb->run (); + } + break; + } + + if (TAO_debug_level > 7) { - // A timeout is specified, run the ORB in an idle loop, if we - // don't handle any operations for the given timeout we just - // exit the loop and this thread ends itself. - ACE_Time_Value tv (this->lane_.dynamic_thread_idle_timeout ()); - while (!orb_core.has_shutdown () && orb->work_pending (tv)) - { - orb->perform_work (); - tv = this->lane_.dynamic_thread_idle_timeout (); - } - - if (TAO_debug_level > 7) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO Process %P Pool %d Lane %d Thread %t\n") - ACE_TEXT ("Current number of dynamic threads left = %d; ") - ACE_TEXT ("RTCorba worker thread is ending!\n"), - this->lane_.pool ().id (), - this->lane_.id (), - this->thr_count () - 1)); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO Process %P Pool %d Lane %d Thread %t\n") + ACE_TEXT ("Current number of dynamic threads left = %d; ") + ACE_TEXT ("RTCorba worker thread is ending!\n"), + this->lane_.pool ().id (), + this->lane_.id (), + this->thr_count () - 1)); } return 0; @@ -140,8 +157,8 @@ TAO_Thread_Lane::TAO_Thread_Lane (TAO_Thread_Pool &pool, CORBA::Short lane_priority, CORBA::ULong static_threads, CORBA::ULong dynamic_threads, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) : pool_ (pool), id_ (id), lane_priority_ (lane_priority), @@ -154,7 +171,8 @@ TAO_Thread_Lane::TAO_Thread_Lane (TAO_Thread_Pool &pool, resources_ (pool.manager ().orb_core (), &new_thread_generator_), native_priority_ (TAO_INVALID_PRIORITY), - dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout) + lifespan_ (lifespan), + dynamic_thread_time_ (dynamic_thread_time) { } @@ -166,13 +184,12 @@ TAO_Thread_Lane::new_dynamic_thread (void) if (this->dynamic_threads_.thr_count () >= this->dynamic_threads_number_) return false; - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, false); - TAO_Thread_Pool_Manager &manager = - this->pool_.manager (); + TAO_Thread_Pool_Manager &manager = this->pool_.manager (); if (!manager.orb_core ().has_shutdown () && !this->shutdown_&& this->dynamic_threads_.thr_count () < this->dynamic_threads_number_) @@ -209,7 +226,7 @@ TAO_Thread_Lane::new_dynamic_thread (void) void TAO_Thread_Lane::shutting_down (void) { - ACE_GUARD (ACE_SYNCH_MUTEX, + ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); @@ -236,8 +253,7 @@ TAO_Thread_Lane::validate_and_map_priority (void) throw ::CORBA::BAD_PARAM (); } - CORBA::ORB_ptr orb = - this->pool_.manager ().orb_core ().orb (); + CORBA::ORB_ptr orb = this->pool_.manager ().orb_core ().orb (); // Get the priority mapping manager. CORBA::Object_var obj = @@ -246,8 +262,7 @@ TAO_Thread_Lane::validate_and_map_priority (void) TAO_Priority_Mapping_Manager_var mapping_manager = TAO_Priority_Mapping_Manager::_narrow (obj.in ()); - RTCORBA::PriorityMapping *pm = - mapping_manager.in ()->mapping (); + RTCORBA::PriorityMapping *pm = mapping_manager.in ()->mapping (); // Map CORBA priority to native priority. CORBA::Boolean const result = @@ -350,7 +365,7 @@ TAO_Thread_Lane::is_collocated (const TAO_MProfile &mprofile) CORBA::ULong TAO_Thread_Lane::current_threads (void) const { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); @@ -363,7 +378,7 @@ TAO_Thread_Lane::current_threads (void) const int TAO_Thread_Lane::create_static_threads (void) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); @@ -377,7 +392,7 @@ TAO_Thread_Lane::create_static_threads (void) int TAO_Thread_Lane::create_dynamic_threads (CORBA::ULong number_of_threads) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); @@ -451,8 +466,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) : manager_ (manager), id_ (id), stack_size_ (stack_size), @@ -460,7 +475,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, allow_request_buffering_ (allow_request_buffering), max_buffered_requests_ (max_buffered_requests), max_request_buffer_size_ (max_request_buffer_size), - dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout), + lifespan_ (lifespan), + dynamic_thread_time_ (dynamic_thread_time), lanes_ (0), number_of_lanes_ (1), with_lanes_ (false) @@ -478,7 +494,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, default_priority, static_threads, dynamic_threads, - dynamic_thread_idle_timeout + lifespan, + dynamic_thread_time )); } @@ -490,8 +507,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) : manager_ (manager), id_ (id), stack_size_ (stack_size), @@ -499,7 +516,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, allow_request_buffering_ (allow_request_buffering), max_buffered_requests_ (max_buffered_requests), max_request_buffer_size_ (max_request_buffer_size), - dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout), + lifespan_ (lifespan), + dynamic_thread_time_ (dynamic_thread_time), lanes_ (0), number_of_lanes_ (lanes.length ()), with_lanes_ (true) @@ -521,7 +539,8 @@ TAO_Thread_Pool::TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, lanes[i].lane_priority, lanes[i].static_threads, lanes[i].dynamic_threads, - dynamic_thread_idle_timeout + lifespan, + dynamic_thread_time )); } @@ -615,7 +634,7 @@ TAO_Thread_Pool::create_static_threads (void) ++i) { // Ask each lane to create its set of static threads. - int result = this->lanes_[i]->create_static_threads (); + int const result = this->lanes_[i]->create_static_threads (); // Return on failure. if (result != 0) @@ -628,7 +647,7 @@ TAO_Thread_Pool::create_static_threads (void) #define TAO_THREAD_POOL_MANAGER_GUARD \ ACE_GUARD_THROW_EX ( \ - ACE_SYNCH_MUTEX, \ + TAO_SYNCH_MUTEX, \ mon, \ this->lock_, \ CORBA::INTERNAL ( \ @@ -692,8 +711,7 @@ TAO_Thread_Pool_Manager::is_collocated (const TAO_MProfile &mprofile) iterator != this->thread_pools_.end (); ++iterator) { - int result = - (*iterator).int_id_->is_collocated (mprofile); + int const result = (*iterator).int_id_->is_collocated (mprofile); if (result) return result; @@ -710,8 +728,8 @@ TAO_Thread_Pool_Manager::create_threadpool (CORBA::ULong stacksize, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) { TAO_THREAD_POOL_MANAGER_GUARD; @@ -722,8 +740,8 @@ TAO_Thread_Pool_Manager::create_threadpool (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - dynamic_thread_idle_timeout - ); + lifespan, + dynamic_thread_time); } RTCORBA::ThreadpoolId @@ -733,8 +751,8 @@ TAO_Thread_Pool_Manager::create_threadpool_with_lanes (CORBA::ULong stacksize, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) { TAO_THREAD_POOL_MANAGER_GUARD; @@ -744,7 +762,8 @@ TAO_Thread_Pool_Manager::create_threadpool_with_lanes (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - dynamic_thread_idle_timeout); + lifespan, + dynamic_thread_time); } void @@ -794,8 +813,8 @@ TAO_Thread_Pool_Manager::create_threadpool_i (CORBA::ULong stacksize, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) { // Create the thread pool. TAO_Thread_Pool *thread_pool = 0; @@ -810,12 +829,12 @@ TAO_Thread_Pool_Manager::create_threadpool_i (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - dynamic_thread_idle_timeout + lifespan, + dynamic_thread_time ), CORBA::NO_MEMORY ()); - return this->create_threadpool_helper (thread_pool - ); + return this->create_threadpool_helper (thread_pool); } RTCORBA::ThreadpoolId @@ -825,8 +844,8 @@ TAO_Thread_Pool_Manager::create_threadpool_with_lanes_i (CORBA::ULong stacksize, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ) + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time) { // Create the thread pool. TAO_Thread_Pool *thread_pool = 0; @@ -840,12 +859,12 @@ TAO_Thread_Pool_Manager::create_threadpool_with_lanes_i (CORBA::ULong stacksize, allow_request_buffering, max_buffered_requests, max_request_buffer_size, - dynamic_thread_idle_timeout + lifespan, + dynamic_thread_time ), CORBA::NO_MEMORY ()); - return this->create_threadpool_helper (thread_pool - ); + return this->create_threadpool_helper (thread_pool); } RTCORBA::ThreadpoolId diff --git a/TAO/tao/RTCORBA/Thread_Pool.h b/TAO/tao/RTCORBA/Thread_Pool.h index 9dc31bdcc4b..d89acdaa822 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.h +++ b/TAO/tao/RTCORBA/Thread_Pool.h @@ -24,6 +24,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/RTCORBA/RTCORBA_includeC.h" +#include "tao/RTCORBA/RT_ORBInitializer.h" #include "ace/Hash_Map_Manager.h" #include "tao/Thread_Lane_Resources.h" #include "tao/New_Leader_Generator.h" @@ -125,14 +126,14 @@ class TAO_Thread_Pool; class TAO_RTCORBA_Export TAO_Thread_Lane { public: - /// Constructor. TAO_Thread_Lane (TAO_Thread_Pool &pool, CORBA::ULong id, CORBA::Short lane_priority, CORBA::ULong static_threads, CORBA::ULong dynamic_threads, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /// Destructor. ~TAO_Thread_Lane (void); @@ -174,7 +175,6 @@ public: /// @name Accessors // @{ - TAO_Thread_Pool &pool (void) const; CORBA::ULong id (void) const; @@ -188,7 +188,9 @@ public: TAO_Thread_Lane_Resources &resources (void); - ACE_Time_Value const &dynamic_thread_idle_timeout (void) const; + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan (void) const; + + ACE_Time_Value const &dynamic_thread_time (void) const; // @} private: @@ -234,10 +236,12 @@ private: CORBA::Short native_priority_; - ACE_Time_Value const dynamic_thread_idle_timeout_; + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan const lifespan_; + + ACE_Time_Value const dynamic_thread_time_; /// Lock to guard all members of the lane - mutable ACE_SYNCH_MUTEX lock_; + mutable TAO_SYNCH_MUTEX lock_; }; class TAO_Thread_Pool_Manager; @@ -265,7 +269,8 @@ public: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /// Constructor (for pools with lanes). TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, @@ -276,7 +281,8 @@ public: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /// Destructor. ~TAO_Thread_Pool (void); @@ -319,7 +325,6 @@ public: TAO_Thread_Lane **lanes (void); CORBA::ULong number_of_lanes (void) const; - // @} private: @@ -332,7 +337,8 @@ private: CORBA::Boolean allow_request_buffering_; CORBA::ULong max_buffered_requests_; CORBA::ULong max_request_buffer_size_; - ACE_Time_Value const dynamic_thread_idle_timeout_; + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan const lifespan_; + ACE_Time_Value const dynamic_thread_time_; TAO_Thread_Lane **lanes_; CORBA::ULong number_of_lanes_; @@ -380,7 +386,8 @@ public: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /// Create a threadpool with lanes. RTCORBA::ThreadpoolId @@ -390,12 +397,11 @@ public: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); /// Destroy a threadpool. - void destroy_threadpool (RTCORBA::ThreadpoolId threadpool - ); + void destroy_threadpool (RTCORBA::ThreadpoolId threadpool); TAO_Thread_Pool *get_threadpool (RTCORBA::ThreadpoolId thread_pool_id); @@ -404,9 +410,7 @@ public: /// @name Accessors // @{ - TAO_ORB_Core &orb_core (void) const; - // @} private: @@ -422,7 +426,8 @@ private: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); RTCORBA::ThreadpoolId create_threadpool_with_lanes_i (CORBA::ULong stacksize, @@ -431,12 +436,11 @@ private: CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, - ACE_Time_Value const &dynamic_thread_idle_timeout - ); + TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, + ACE_Time_Value const &dynamic_thread_time); RTCORBA::ThreadpoolId create_threadpool_helper (TAO_Thread_Pool *thread_pool); - // @} private: @@ -445,7 +449,7 @@ private: THREAD_POOLS thread_pools_; RTCORBA::ThreadpoolId thread_pool_id_counter_; - ACE_SYNCH_MUTEX lock_; + TAO_SYNCH_MUTEX lock_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTCORBA/Thread_Pool.inl b/TAO/tao/RTCORBA/Thread_Pool.inl index 4dd08236764..eadf4ae0ebe 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.inl +++ b/TAO/tao/RTCORBA/Thread_Pool.inl @@ -61,10 +61,17 @@ TAO_Thread_Lane::resources (void) } ACE_INLINE +TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan +TAO_Thread_Lane::lifespan (void) const +{ + return this->lifespan_; +} + +ACE_INLINE ACE_Time_Value const & -TAO_Thread_Lane::dynamic_thread_idle_timeout (void) const +TAO_Thread_Lane::dynamic_thread_time (void) const { - return this->dynamic_thread_idle_timeout_; + return this->dynamic_thread_time_; } ACE_INLINE diff --git a/TAO/tao/Remote_Invocation.cpp b/TAO/tao/Remote_Invocation.cpp index 8659724739e..a0b0b7434a2 100644 --- a/TAO/tao/Remote_Invocation.cpp +++ b/TAO/tao/Remote_Invocation.cpp @@ -4,7 +4,6 @@ #include "tao/Profile.h" #include "tao/Profile_Transport_Resolver.h" #include "tao/Stub.h" -#include "tao/Transport.h" #include "tao/Connection_Handler.h" #include "tao/operation_details.h" #include "tao/ORB_Core.h" @@ -99,9 +98,11 @@ namespace TAO } void - Remote_Invocation::write_header (TAO_Target_Specification &spec, - TAO_OutputCDR &out_stream) + Remote_Invocation::write_header (TAO_OutputCDR &out_stream) { + TAO_Target_Specification spec; + this->init_target_spec (spec); + this->resolver_.transport ()->clear_translators (0, &out_stream); // Send the request for the header @@ -126,7 +127,7 @@ namespace TAO Invocation_Status Remote_Invocation::send_message (TAO_OutputCDR &cdr, - short message_semantics, + TAO_Transport::TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { TAO_Protocols_Hooks *tph = @@ -142,7 +143,7 @@ namespace TAO if (nph != 0) { // nph = 0, means DiffServ library is not used - // nph = 0, means DiffServ library is used, and + // nph = 0, means DiffServ library is used, and // request DSCP and reply DSCP are set. // Note that the application could still be using // RTCORBA, but still setting DIffServ codepoints diff --git a/TAO/tao/Remote_Invocation.h b/TAO/tao/Remote_Invocation.h index ce45b946d6b..4a52d2f57a7 100644 --- a/TAO/tao/Remote_Invocation.h +++ b/TAO/tao/Remote_Invocation.h @@ -17,6 +17,7 @@ #include /**/ "ace/pre.h" #include "tao/Invocation_Base.h" +#include "tao/Transport.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -68,15 +69,14 @@ namespace TAO void init_target_spec (TAO_Target_Specification &spec); /// Write the GIOP header into the stream. - void write_header (TAO_Target_Specification &spec, - TAO_OutputCDR &out_stream); + void write_header (TAO_OutputCDR &out_stream); /// Marshal the arguments into the stream. void marshal_data (TAO_OutputCDR &cdr); /// Write the message onto the socket Invocation_Status send_message (TAO_OutputCDR &cdr, - short message_semantics, + TAO_Transport::TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); protected: diff --git a/TAO/tao/Request_Dispatcher.h b/TAO/tao/Request_Dispatcher.h index 559993dfe33..69c5a1c7ea3 100644 --- a/TAO/tao/Request_Dispatcher.h +++ b/TAO/tao/Request_Dispatcher.h @@ -24,9 +24,9 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/TAO_Export.h" #include "tao/Pseudo_VarOut_T.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_ORB_Core; diff --git a/TAO/tao/Resume_Handle.h b/TAO/tao/Resume_Handle.h index 1515ddf04c8..fed8fb32a61 100644 --- a/TAO/tao/Resume_Handle.h +++ b/TAO/tao/Resume_Handle.h @@ -73,12 +73,11 @@ public: /// reactor. Else we don't resume the handle. void resume_handle (void); - // Hook method called at the end of a connection handler's - // handle_input function. Might override the handle_input - // return value or change the resume_handler's flag_ value. + /// Hook method called at the end of a connection handler's + /// handle_input function. Might override the handle_input + /// return value or change the resume_handler's flag_ value. void handle_input_return_value_hook (int& return_value); - private: /// Our ORB Core. diff --git a/TAO/tao/Strategies/COIOP_Transport.cpp b/TAO/tao/Strategies/COIOP_Transport.cpp index b7901e74e9c..98558936eb5 100644 --- a/TAO/tao/Strategies/COIOP_Transport.cpp +++ b/TAO/tao/Strategies/COIOP_Transport.cpp @@ -91,7 +91,7 @@ int TAO_COIOP_Transport::send_request (TAO_Stub *, TAO_ORB_Core *, TAO_OutputCDR &, - int, + TAO_Message_Semantics, ACE_Time_Value *) { return 0; @@ -99,18 +99,18 @@ TAO_COIOP_Transport::send_request (TAO_Stub *, int TAO_COIOP_Transport::send_message (TAO_OutputCDR &, - TAO_Stub *, - int, - ACE_Time_Value *) + TAO_Stub *, + TAO_Message_Semantics, + ACE_Time_Value *) { return 1; } int TAO_COIOP_Transport::send_message_shared (TAO_Stub *, - int, - const ACE_Message_Block *, - ACE_Time_Value *) + TAO_Message_Semantics, + const ACE_Message_Block *, + ACE_Time_Value *) { return 1; } diff --git a/TAO/tao/Strategies/COIOP_Transport.h b/TAO/tao/Strategies/COIOP_Transport.h index 7d7ab6a1dbd..1046ad06d51 100644 --- a/TAO/tao/Strategies/COIOP_Transport.h +++ b/TAO/tao/Strategies/COIOP_Transport.h @@ -81,7 +81,7 @@ protected: const ACE_Time_Value *s = 0); virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -94,12 +94,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); private: diff --git a/TAO/tao/Strategies/DIOP_Transport.cpp b/TAO/tao/Strategies/DIOP_Transport.cpp index 30512c277a0..535ce2a53a6 100644 --- a/TAO/tao/Strategies/DIOP_Transport.cpp +++ b/TAO/tao/Strategies/DIOP_Transport.cpp @@ -226,7 +226,7 @@ int TAO_DIOP_Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, message_semantics) == -1) @@ -247,7 +247,7 @@ TAO_DIOP_Transport::send_request (TAO_Stub *stub, int TAO_DIOP_Transport::send_message (TAO_OutputCDR &stream, TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { // Format the message in the stream first @@ -281,7 +281,7 @@ TAO_DIOP_Transport::send_message (TAO_OutputCDR &stream, int TAO_DIOP_Transport::send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time) { diff --git a/TAO/tao/Strategies/DIOP_Transport.h b/TAO/tao/Strategies/DIOP_Transport.h index ff3bafc1883..ba3363dfdcf 100644 --- a/TAO/tao/Strategies/DIOP_Transport.h +++ b/TAO/tao/Strategies/DIOP_Transport.h @@ -85,7 +85,7 @@ protected: const ACE_Time_Value *s = 0); virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -98,12 +98,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); private: diff --git a/TAO/tao/Strategies/SCIOP_Transport.cpp b/TAO/tao/Strategies/SCIOP_Transport.cpp index 575cb609323..903ccf22922 100644 --- a/TAO/tao/Strategies/SCIOP_Transport.cpp +++ b/TAO/tao/Strategies/SCIOP_Transport.cpp @@ -109,10 +109,10 @@ TAO_SCIOP_Transport::recv (char *buf, int TAO_SCIOP_Transport::send_request (TAO_Stub *stub, - TAO_ORB_Core *orb_core, - TAO_OutputCDR &stream, - int message_semantics, - ACE_Time_Value *max_wait_time) + TAO_ORB_Core *orb_core, + TAO_OutputCDR &stream, + TAO_Message_Semantics message_semantics, + ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, message_semantics) == -1) @@ -132,9 +132,9 @@ TAO_SCIOP_Transport::send_request (TAO_Stub *stub, int TAO_SCIOP_Transport::send_message (TAO_OutputCDR &stream, - TAO_Stub *stub, - int message_semantics, - ACE_Time_Value *max_wait_time) + TAO_Stub *stub, + TAO_Message_Semantics message_semantics, + ACE_Time_Value *max_wait_time) { // Format the message in the stream first if (this->messaging_object_->format_message (stream) != 0) @@ -161,9 +161,9 @@ TAO_SCIOP_Transport::send_message (TAO_OutputCDR &stream, int TAO_SCIOP_Transport::send_message_shared (TAO_Stub *stub, - int message_semantics, - const ACE_Message_Block *message_block, - ACE_Time_Value *max_wait_time) + TAO_Message_Semantics message_semantics, + const ACE_Message_Block *message_block, + ACE_Time_Value *max_wait_time) { int r; @@ -184,8 +184,8 @@ TAO_SCIOP_Transport::send_message_shared (TAO_Stub *stub, int TAO_SCIOP_Transport::generate_request_header (TAO_Operation_Details &opdetails, - TAO_Target_Specification &spec, - TAO_OutputCDR &msg) + TAO_Target_Specification &spec, + TAO_OutputCDR &msg) { // Check whether we have a Bi Dir SCIOP policy set, whether the // messaging objects are ready to handle bidirectional connections diff --git a/TAO/tao/Strategies/SCIOP_Transport.h b/TAO/tao/Strategies/SCIOP_Transport.h index bf57a245b43..6838be27c87 100644 --- a/TAO/tao/Strategies/SCIOP_Transport.h +++ b/TAO/tao/Strategies/SCIOP_Transport.h @@ -79,7 +79,7 @@ protected: const ACE_Time_Value *s = 0); virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -90,12 +90,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &association, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &association, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); /*virtual int send_reply (TAO_OutputCDR &stream, diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp index 61aa14a4b33..bd8d5f60170 100644 --- a/TAO/tao/Strategies/SHMIOP_Transport.cpp +++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp @@ -96,7 +96,7 @@ TAO_SHMIOP_Transport::recv (char *buf, if (TAO_debug_level > 3 && errno != ETIME) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - %p \n"), + ACE_TEXT ("TAO (%P|%t) - SHMIOP_Transport::recv, %p \n"), ACE_TEXT ("TAO - read message failure ") ACE_TEXT ("recv_i () \n"))); } @@ -273,7 +273,7 @@ int TAO_SHMIOP_Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, @@ -293,9 +293,9 @@ TAO_SHMIOP_Transport::send_request (TAO_Stub *stub, int TAO_SHMIOP_Transport::send_message (TAO_OutputCDR &stream, - TAO_Stub *stub, - int message_semantics, - ACE_Time_Value *max_wait_time) + TAO_Stub *stub, + TAO_Message_Semantics message_semantics, + ACE_Time_Value *max_wait_time) { // Format the message in the stream first if (this->messaging_object_->format_message (stream) != 0) @@ -315,7 +315,7 @@ TAO_SHMIOP_Transport::send_message (TAO_OutputCDR &stream, { if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport %d after fault %p\n"), + ACE_TEXT ("TAO (%P|%t) closing transport %d after fault %p\n"), this->id (), ACE_TEXT ("send_message ()\n"))); diff --git a/TAO/tao/Strategies/SHMIOP_Transport.h b/TAO/tao/Strategies/SHMIOP_Transport.h index a4142951b79..79a05c1f005 100644 --- a/TAO/tao/Strategies/SHMIOP_Transport.h +++ b/TAO/tao/Strategies/SHMIOP_Transport.h @@ -91,12 +91,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); private: diff --git a/TAO/tao/Strategies/UIOP_Transport.cpp b/TAO/tao/Strategies/UIOP_Transport.cpp index ff191c58395..3327173b771 100644 --- a/TAO/tao/Strategies/UIOP_Transport.cpp +++ b/TAO/tao/Strategies/UIOP_Transport.cpp @@ -76,7 +76,7 @@ TAO_UIOP_Transport::recv (char *buf, errno != ETIME) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - %p \n"), + ACE_TEXT ("TAO (%P|%t) - UIOP_Transport::recv, %p %p \n"), ACE_TEXT ("TAO - read message failure ") ACE_TEXT ("recv () \n"))); } @@ -102,7 +102,7 @@ int TAO_UIOP_Transport::send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { if (this->ws_->sending_request (orb_core, message_semantics) == -1) @@ -119,7 +119,7 @@ TAO_UIOP_Transport::send_request (TAO_Stub *stub, int TAO_UIOP_Transport::send_message (TAO_OutputCDR &stream, TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time) { // Format the message in the stream first @@ -140,7 +140,7 @@ TAO_UIOP_Transport::send_message (TAO_OutputCDR &stream, { if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport %d after fault %p\n"), + ACE_TEXT ("TAO (%P|%t) closing transport %d after fault %p\n"), this->id (), ACE_TEXT ("send_message ()\n"))); diff --git a/TAO/tao/Strategies/UIOP_Transport.h b/TAO/tao/Strategies/UIOP_Transport.h index bd37c90d808..3c596e74c73 100644 --- a/TAO/tao/Strategies/UIOP_Transport.h +++ b/TAO/tao/Strategies/UIOP_Transport.h @@ -85,12 +85,12 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time); virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0); //@} diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 2031d848c2d..ceb3649a031 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -58,9 +58,6 @@ namespace TAO TAO_Synch_Reply_Dispatcher rd (this->resolver_.stub ()->orb_core (), this->details_.reply_service_info ()); - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 @@ -76,15 +73,24 @@ namespace TAO try { #endif /*TAO_HAS_INTERCEPTORS */ + TAO_Transport* const transport = this->resolver_.transport (); + + if (!transport) + { + // Way back, we failed to find a profile we could connect to. + // We've come this far only so we reach the interception points + // in case they can fix things. Time to bail.... + throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + } - TAO_OutputCDR &cdr = this->resolver_.transport ()->out_stream (); + TAO_OutputCDR &cdr = transport->out_stream (); cdr.message_attributes (this->details_.request_id (), this->resolver_.stub (), TAO_Transport::TAO_TWOWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); @@ -93,13 +99,13 @@ namespace TAO TAO_Bind_Dispatcher_Guard dispatch_guard ( this->details_.request_id (), &rd, - this->resolver_.transport ()->tms ()); + transport->tms ()); if (dispatch_guard.status () != 0) { // @@ What is the right way to handle this error? Why should // we close the connection? - this->resolver_.transport ()->close_connection (); + transport->close_connection (); throw ::CORBA::INTERNAL (0, CORBA::COMPLETED_NO); } @@ -132,7 +138,7 @@ namespace TAO // For some strategies one may want to release the transport // back to cache. If the idling is successfull let the // resolver about that. - if (this->resolver_.transport ()->idle_after_send ()) + if (transport->idle_after_send ()) this->resolver_.transport_released (); // @@ In all MT environments, there's a cancellation point lurking @@ -175,7 +181,7 @@ namespace TAO // For some strategies one may want to release the transport // back to cache after receiving the reply. - if (this->resolver_.transport ()->idle_after_reply ()) + if (transport->idle_after_reply ()) this->resolver_.transport_released (); #if TAO_HAS_INTERCEPTORS == 1 @@ -238,7 +244,7 @@ namespace TAO int const reply_error = this->resolver_.transport ()->wait_strategy ()->wait (max_wait_time, rd); - if (TAO_debug_level > 0 && max_wait_time != 0) + if (TAO_debug_level > 0 && max_wait_time) { CORBA::ULong const msecs = max_wait_time->msec (); @@ -622,9 +628,6 @@ namespace TAO return s; } - TAO_Target_Specification tspec; - this->init_target_spec (tspec); - #if TAO_HAS_INTERCEPTORS == 1 s = this->send_request_interception (); @@ -634,9 +637,16 @@ namespace TAO try { #endif /*TAO_HAS_INTERCEPTORS */ - TAO_Transport* const transport = this->resolver_.transport (); + if (!transport) + { + // Way back, we failed to find a profile we could connect to. + // We've come this far only so we reach the interception points + // in case they can fix things. Time to bail.... + throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); + } + TAO_OutputCDR &cdr = transport->out_stream (); cdr.message_attributes (this->details_.request_id (), @@ -644,7 +654,7 @@ namespace TAO TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time); - this->write_header (tspec, cdr); + this->write_header (cdr); this->marshal_data (cdr); diff --git a/TAO/tao/SystemException.cpp b/TAO/tao/SystemException.cpp index c2a8e88b54b..db2cf2fbb35 100644 --- a/TAO/tao/SystemException.cpp +++ b/TAO/tao/SystemException.cpp @@ -676,7 +676,7 @@ CORBA::SystemException::_tao_get_omg_exception_description ( if (minor_code == 0) return "*unknown description*"; - minor_code--; // Adjust to match table offset. + --minor_code; // Adjust to match table offset. CORBA::UNKNOWN const * unknown_exception = dynamic_cast <const CORBA::UNKNOWN *> (&exc); diff --git a/TAO/tao/TAO_Singleton_Manager.cpp b/TAO/tao/TAO_Singleton_Manager.cpp index 345d30cb3f9..4c4151de3b0 100644 --- a/TAO/tao/TAO_Singleton_Manager.cpp +++ b/TAO/tao/TAO_Singleton_Manager.cpp @@ -72,7 +72,7 @@ TAO_Singleton_Manager::TAO_Singleton_Manager (void) TAO_Singleton_Manager::~TAO_Singleton_Manager (void) { - this->dynamically_allocated_ = 0; // Don't delete this again in fini() + this->dynamically_allocated_ = false; // Don't delete this again in fini() (void) this->fini (); } @@ -113,7 +113,7 @@ TAO_Singleton_Manager::instance (void) 0); ACE_ASSERT (instance_pointer == the_instance); - instance_pointer->dynamically_allocated_ = 1; + instance_pointer->dynamically_allocated_ = true; return instance_pointer; } diff --git a/TAO/tao/Thread_Per_Connection_Handler.cpp b/TAO/tao/Thread_Per_Connection_Handler.cpp index 9cf61f3bfc2..884b7eff152 100644 --- a/TAO/tao/Thread_Per_Connection_Handler.cpp +++ b/TAO/tao/Thread_Per_Connection_Handler.cpp @@ -15,7 +15,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Thread_Per_Connection_Handler::TAO_Thread_Per_Connection_Handler ( TAO_Connection_Handler *ch, TAO_ORB_Core *oc) - : TAO_TPC_BASE (oc->thr_mgr ()) + : ACE_Task_Base (oc->thr_mgr ()) , ch_ (ch) { this->ch_->transport ()->add_reference (); @@ -28,39 +28,6 @@ TAO_Thread_Per_Connection_Handler::~TAO_Thread_Per_Connection_Handler (void) } int -TAO_Thread_Per_Connection_Handler::activate (long flags, - int n_threads, - int force_active, - long priority, - int grp_id, - ACE_Task_Base *task, - ACE_hthread_t thread_handles[], - void *stack[], - size_t stack_size[], - ACE_thread_t thread_names[]) -{ - if (TAO_debug_level) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - Thread_Per_Connection_Handler::") - ACE_TEXT ("activate %d threads, flags = %d\n"), - n_threads, - flags)); - } - - return TAO_TPC_BASE::activate (flags, - n_threads, - force_active, - priority, - grp_id, - task, - thread_handles, - stack, - stack_size, - thread_names); -} - -int TAO_Thread_Per_Connection_Handler::svc (void) { ACE::clr_flags (this->ch_->transport ()->event_handler_i ()->get_handle (), diff --git a/TAO/tao/Thread_Per_Connection_Handler.h b/TAO/tao/Thread_Per_Connection_Handler.h index 435e07c88a0..7e7f667062b 100644 --- a/TAO/tao/Thread_Per_Connection_Handler.h +++ b/TAO/tao/Thread_Per_Connection_Handler.h @@ -17,7 +17,7 @@ #define TAO_THREAD_PER_CONNECTION_HANDLER_H #include /**/ "ace/pre.h" -#include "ace/Task_T.h" +#include "ace/Task.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -31,8 +31,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Connection_Handler; class TAO_ORB_Core; -typedef ACE_Task<ACE_NULL_SYNCH> TAO_TPC_BASE; - /** * @class TAO_Thread_Per_Connection_Handler * @@ -43,7 +41,7 @@ typedef ACE_Task<ACE_NULL_SYNCH> TAO_TPC_BASE; * messages. * */ -class TAO_Export TAO_Thread_Per_Connection_Handler : public TAO_TPC_BASE +class TAO_Export TAO_Thread_Per_Connection_Handler : public ACE_Task_Base { public: TAO_Thread_Per_Connection_Handler (TAO_Connection_Handler *ch, @@ -51,21 +49,6 @@ public: ~TAO_Thread_Per_Connection_Handler (void); - /// = Active object activation method. - /** - * @todo This probably needs to go after x.4.1 - */ - virtual int activate (long flags = THR_NEW_LWP, - int n_threads = 1, - int force_active = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_thread_t thread_names[] = 0); - /// Template hook method that the thread uses... /** * Please see the documentation in ace/Task.h for details. diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 0232a41c81e..5b8360e7cbf 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -290,7 +290,7 @@ TAO_Transport::tear_listen_point_list (TAO_InputCDR &) int TAO_Transport::send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time) { @@ -672,12 +672,10 @@ TAO_Transport::send_reply_message_i (const ACE_Message_Block *mb, // Dont clone now.. We could be sent in one shot! TAO_Synch_Queued_Message synch_message (mb, this->orb_core_); - synch_message.push_back (this->head_, - this->tail_); + synch_message.push_back (this->head_, this->tail_); int const n = - this->send_synch_message_helper_i (synch_message, - max_wait_time); + this->send_synch_message_helper_i (synch_message, max_wait_time); if (n == -1 || n == 1) { @@ -724,7 +722,7 @@ TAO_Transport::send_reply_message_i (const ACE_Message_Block *mb, typedef ACE_Reverse_Lock<ACE_Lock> TAO_REVERSE_LOCK; TAO_REVERSE_LOCK reverse (*this->handler_lock_); ACE_GUARD_RETURN (TAO_REVERSE_LOCK, ace_mon, reverse, -1); - (void) flushing_strategy->flush_message(this, msg, 0); + (void) flushing_strategy->flush_message (this, msg, 0); } return 1; @@ -774,11 +772,10 @@ TAO_Transport::schedule_output_i (void) // Check to see if our event handler is still registered with the // reactor. It's possible for another thread to have run close_connection() // since we last used the event handler. - ACE_Event_Handler * const found = reactor->find_handler (eh->get_handle ()); if (found) { - found->remove_reference (); + found->remove_reference (); if (found != eh) { @@ -929,8 +926,8 @@ TAO_Transport::drain_queue_helper (int &iovcnt, iovec iov[]) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - Transport[%d]::drain_queue_helper, ") - ACE_TEXT ("error during %p\n"), - this->id (), ACE_TEXT ("send()"))); + ACE_TEXT ("error during send (errno: %d) - %m\n"), + this->id (), errno)); } if (errno == EWOULDBLOCK || errno == EAGAIN) @@ -966,7 +963,7 @@ TAO_Transport::drain_queue_i (void) // sent int iovcnt = 0; #if defined (ACE_INITIALIZE_MEMORY_BEFORE_USE) - iovec iov[ACE_IOV_MAX] = { 0 , 0 }; + iovec iov[ACE_IOV_MAX] = { { 0 , 0 } }; #else iovec iov[ACE_IOV_MAX]; #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */ @@ -1010,8 +1007,7 @@ TAO_Transport::drain_queue_i (void) // IOV_MAX elements ... if (iovcnt == ACE_IOV_MAX) { - int const retval = - this->drain_queue_helper (iovcnt, iov); + int const retval = this->drain_queue_helper (iovcnt, iov); now = ACE_High_Res_Timer::gettimeofday_hr (); @@ -1241,7 +1237,7 @@ TAO_Transport::send_connection_closed_notifications_i (void) int TAO_Transport::send_message_shared_i (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time) { @@ -1254,13 +1250,11 @@ TAO_Transport::send_message_shared_i (TAO_Stub *stub, switch (message_semantics) { case TAO_Transport::TAO_TWOWAY_REQUEST: - ret = this->send_synchronous_message_i (message_block, - max_wait_time); + ret = this->send_synchronous_message_i (message_block, max_wait_time); break; case TAO_Transport::TAO_REPLY: - ret = this->send_reply_message_i (message_block, - max_wait_time); + ret = this->send_reply_message_i (message_block, max_wait_time); break; case TAO_Transport::TAO_ONEWAY_REQUEST: @@ -1727,7 +1721,6 @@ TAO_Transport::handle_input_missing_data (TAO_Resume_Handle &rh, recv_size, max_wait_time); - if (n <= 0) { return n; diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index 90ada1bca88..b4dc1a1b5cc 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -596,7 +596,7 @@ public: virtual int handle_input (TAO_Resume_Handle &rh, ACE_Time_Value *max_wait_time = 0); - enum + enum TAO_Message_Semantics { TAO_ONEWAY_REQUEST = 0, TAO_TWOWAY_REQUEST = 1, @@ -632,7 +632,7 @@ public: virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, - int message_semantics, + TAO_Message_Semantics message_semantics, ACE_Time_Value *max_time_wait) = 0; /// This method formats the stream and then sends the message on the @@ -646,7 +646,7 @@ public: */ virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub = 0, - int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, + TAO_Message_Semantics message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait = 0) = 0; /// Sent the contents of @a message_block @@ -665,7 +665,7 @@ public: * block, used in the implementation of timeouts. */ virtual int send_message_shared (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); @@ -679,7 +679,7 @@ protected: /// Implement send_message_shared() assuming the handler_lock_ is /// held. int send_message_shared_i (TAO_Stub *stub, - int message_semantics, + TAO_Message_Semantics message_semantics, const ACE_Message_Block *message_block, ACE_Time_Value *max_wait_time); diff --git a/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp b/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp index fa49fcf0104..4c32d82327e 100644 --- a/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp +++ b/TAO/tao/TransportCurrent/IIOP_Current_Impl.cpp @@ -20,7 +20,7 @@ namespace TAO /// Obtains the IIOP_Connection_Handler associated with the - /// Transport. Will throw NO_IMPLEMENT if the (selected) transport + /// Transport. Will throw NoContext if the (selected) transport /// () == 0, or if transport->connection_handler () == 0. Will /// throw NoContext, if no transport has been selected yet. @@ -30,11 +30,11 @@ namespace TAO #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0) const TAO_Transport* t = this->transport (); if (t == 0) - throw ::CORBA::NO_IMPLEMENT (); + throw NoContext (); TAO_Connection_Handler *ch = const_cast<TAO_Transport*>(t)->connection_handler (); if (ch == 0) - throw ::CORBA::NO_IMPLEMENT (); + throw NoContext (); return dynamic_cast <TAO_IIOP_Connection_Handler*> (ch); #else diff --git a/TAO/tao/TransportCurrent/IIOP_Current_Impl.h b/TAO/tao/TransportCurrent/IIOP_Current_Impl.h index 0495f17b6f4..99fac36e54e 100644 --- a/TAO/tao/TransportCurrent/IIOP_Current_Impl.h +++ b/TAO/tao/TransportCurrent/IIOP_Current_Impl.h @@ -78,7 +78,7 @@ namespace TAO private: /// Returns the IIOP connection handler associated with the - /// Transport. Will throw NO_IMPLEMENT if the (selected) transport + /// Transport. Will throw NoContext if the (selected) transport /// () == 0, or if transport->connection_handler () == 0. Will /// throw NoContext, if no transport has been selected yet. TAO_IIOP_Connection_Handler* handler (void); diff --git a/TAO/tao/Utils/ORB_Manager.cpp b/TAO/tao/Utils/ORB_Manager.cpp index 5776a957e1c..4ab7af28e56 100644 --- a/TAO/tao/Utils/ORB_Manager.cpp +++ b/TAO/tao/Utils/ORB_Manager.cpp @@ -254,6 +254,10 @@ TAO_ORB_Manager::~TAO_ORB_Manager (void) { this->poa_->destroy (1,1); } + if (!CORBA::is_nil (this->orb_.in ())) + { + this->orb_->destroy (); + } } catch (const ::CORBA::Exception&) { diff --git a/TAO/tao/Version.h b/TAO/tao/Version.h index b42e1941460..dd89f087857 100644 --- a/TAO/tao/Version.h +++ b/TAO/tao/Version.h @@ -5,5 +5,5 @@ #define TAO_MAJOR_VERSION 1 #define TAO_MINOR_VERSION 6 -#define TAO_BETA_VERSION 1 -#define TAO_VERSION "1.6.1" +#define TAO_BETA_VERSION 2 +#define TAO_VERSION "1.6.2" diff --git a/TAO/tao/operation_details.h b/TAO/tao/operation_details.h index cd4ac8c27ba..d2cee96e030 100644 --- a/TAO/tao/operation_details.h +++ b/TAO/tao/operation_details.h @@ -20,6 +20,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/Exception.h" #include "tao/TimeBaseC.h" #include "tao/target_specification.h" diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index bbdb3d94356..fb9cace70ac 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -41,10 +41,12 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL #define TAO_NULL_LOCK_REACTOR ACE_Select_Reactor_T< ACE_Reactor_Token_T<ACE_Noop_Token> > #endif /* TAO_NULL_LOCK_REACTOR */ +//FUZZ: disable check_for_ACE_SYNCH_MUTEX // Define this to modify the default mutex type used throughout TAO. #if !defined (TAO_SYNCH_MUTEX) #define TAO_SYNCH_MUTEX ACE_SYNCH_MUTEX #endif /* TAO_SYNCH_MUTEX */ +//FUZZ: enable check_for_ACE_SYNCH_MUTEX #if !defined (TAO_SYNCH_RECURSIVE_MUTEX) #define TAO_SYNCH_RECURSIVE_MUTEX ACE_SYNCH_RECURSIVE_MUTEX diff --git a/TAO/tests/BiDirectional/run_test.pl b/TAO/tests/BiDirectional/run_test.pl index 60ee4d12551..a424f9052a4 100755 --- a/TAO/tests/BiDirectional/run_test.pl +++ b/TAO/tests/BiDirectional/run_test.pl @@ -20,7 +20,7 @@ if (PerlACE::is_vxworks_test()) { else { $SV = new PerlACE::Process ("server", "-o $iorfile -i 100"); } -$CL = new PerlACE::Process ("client", "-k file://$iorfile -ORBDottedDecimalAddresses 1"); +$CL = new PerlACE::Process ("client", "-k file://$iorfile"); # print $SV->CommandLine ()."\n"; $SV->Spawn (); diff --git a/TAO/tests/Big_Oneways/Session.cpp b/TAO/tests/Big_Oneways/Session.cpp index 1abeb5c48e1..217a6415ea0 100644 --- a/TAO/tests/Big_Oneways/Session.cpp +++ b/TAO/tests/Big_Oneways/Session.cpp @@ -68,7 +68,7 @@ Session::svc (void) } { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1); this->active_thread_count_--; if (this->more_work ()) { @@ -119,7 +119,7 @@ Session::start (const Test::Session_List &other_sessions) throw Test::No_Peers (); { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); if (this->running_) throw Test::Already_Running (); @@ -183,7 +183,7 @@ Session::receive_payload (const Test::Payload &the_payload) } { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); --this->expected_messages_; #if 0 diff --git a/TAO/tests/Big_Oneways/Session.h b/TAO/tests/Big_Oneways/Session.h index d34af92249d..d7ead0a9a8c 100644 --- a/TAO/tests/Big_Oneways/Session.h +++ b/TAO/tests/Big_Oneways/Session.h @@ -57,7 +57,7 @@ private: private: /// Synchronize the internal state - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; /// Keep a reference to the Session_Control, this is used to report /// when the test finishes. diff --git a/TAO/tests/Big_Oneways/Session_Control.cpp b/TAO/tests/Big_Oneways/Session_Control.cpp index 9c298313d19..d0fab0de5fa 100644 --- a/TAO/tests/Big_Oneways/Session_Control.cpp +++ b/TAO/tests/Big_Oneways/Session_Control.cpp @@ -43,7 +43,7 @@ Session_Control::~Session_Control (void) void Session_Control::session_finished (CORBA::Boolean success) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); if (this->session_count_ == 0) { ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Big_Oneways/Session_Control.h b/TAO/tests/Big_Oneways/Session_Control.h index 2da60584c36..96a6d734e72 100644 --- a/TAO/tests/Big_Oneways/Session_Control.h +++ b/TAO/tests/Big_Oneways/Session_Control.h @@ -30,7 +30,7 @@ public: private: /// Synchronize the internal state - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; /// The type of test CORBA::ULong session_count_; diff --git a/TAO/tests/Big_Oneways/run_test.pl b/TAO/tests/Big_Oneways/run_test.pl index 9e4f729e416..8393570a65c 100755 --- a/TAO/tests/Big_Oneways/run_test.pl +++ b/TAO/tests/Big_Oneways/run_test.pl @@ -23,24 +23,22 @@ if (defined $opt_i) { if (defined $opt_b) { $server_args .= " -b ".$opt_b; } - -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); $status = 0; unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior $server_args -ORBDottedDecimalAddresses 1"); - $CL1 = new PerlACE::Process ("client", " -k file://$iorfile -ORBDottedDecimalAddresses 1"); - $CL2 = new PerlACE::Process ("client", " -k file://$iorfile -ORBDottedDecimalAddresses 1"); - $CL3 = new PerlACE::Process ("client", " -k file://$iorfile -ORBDottedDecimalAddresses 1"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase $server_args"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile $server_args"); - $CL1 = new PerlACE::Process ("client", " -k file://$iorfile"); - $CL2 = new PerlACE::Process ("client", " -k file://$iorfile"); - $CL3 = new PerlACE::Process ("client", " -k file://$iorfile"); } +$CL1 = new PerlACE::Process ("client", " -k file://$iorfile"); +$CL2 = new PerlACE::Process ("client", " -k file://$iorfile"); +$CL3 = new PerlACE::Process ("client", " -k file://$iorfile"); + $server = $SV->Spawn (); if ($server != 0) { diff --git a/TAO/tests/Big_Reply/Client_Task.cpp b/TAO/tests/Big_Reply/Client_Task.cpp index 8e1f4af358e..1cff6fff879 100644 --- a/TAO/tests/Big_Reply/Client_Task.cpp +++ b/TAO/tests/Big_Reply/Client_Task.cpp @@ -60,9 +60,10 @@ Client_Task::validate_connection (void) { try { - this->reply_gen_->ping (); } - catch (const CORBA::Exception&){} + catch (const CORBA::Exception&) + { + } } } diff --git a/TAO/tests/Big_Reply/server.cpp b/TAO/tests/Big_Reply/server.cpp index a22e1ef6d44..6d2afa4278f 100644 --- a/TAO/tests/Big_Reply/server.cpp +++ b/TAO/tests/Big_Reply/server.cpp @@ -3,7 +3,7 @@ #include "ace/Get_Opt.h" #include "Big_Reply_i.h" #include "ace/OS_NS_stdio.h" - +#include "ace/Task.h" ACE_RCSID(Big_Reply, server, "$Id$") @@ -12,10 +12,36 @@ const char *ior_output_file = "test.ior"; // We can change this value if wanted.. const CORBA::ULong data_size = 4000000; +class OrbTask : public ACE_Task_Base +{ +public: + OrbTask(const CORBA::ORB_ptr orb) + : orb_(CORBA::ORB::_duplicate(orb)) + { + } + + virtual int svc() + { + try + { + this->orb_->run (); + } + catch (const CORBA::Exception&) + { + } + return 0; + } + +private: + CORBA::ORB_var orb_; +}; + +static int n_threads = 1; + int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:s:"); + ACE_Get_Opt get_opts (argc, argv, "o:s:t:"); int c; while ((c = get_opts ()) != -1) @@ -24,6 +50,9 @@ parse_args (int argc, char *argv[]) case 'o': ior_output_file = get_opts.opt_arg (); break; + case 't': + n_threads = ACE_OS::atoi(get_opts.opt_arg()); + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -66,7 +95,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) if (parse_args (argc, argv) != 0) return 1; - Big_Reply_i *big_reply_gen; + Big_Reply_i *big_reply_gen = 0; ACE_NEW_RETURN (big_reply_gen, Big_Reply_i (orb.in (), @@ -99,7 +128,15 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) poa_manager->activate (); - orb->run (); + OrbTask task(orb.in()); + + if (task.activate (THR_NEW_LWP | THR_JOINABLE, + n_threads) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot activate threads\n"), + 1); + task.wait(); + ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, 1); diff --git a/TAO/tests/Big_Request_Muxing/Client_Task.cpp b/TAO/tests/Big_Request_Muxing/Client_Task.cpp index dcdbe2d82f1..39c38c7cd93 100644 --- a/TAO/tests/Big_Request_Muxing/Client_Task.cpp +++ b/TAO/tests/Big_Request_Muxing/Client_Task.cpp @@ -76,7 +76,6 @@ Client_Task::svc (void) CORBA::Any scope_as_any; scope_as_any <<= this->sync_scope_; - CORBA::PolicyList policy_list (1); policy_list.length (1); policy_list[0] = diff --git a/TAO/tests/Big_Twoways/Session.cpp b/TAO/tests/Big_Twoways/Session.cpp index 9a176764603..9c90a5e0554 100644 --- a/TAO/tests/Big_Twoways/Session.cpp +++ b/TAO/tests/Big_Twoways/Session.cpp @@ -66,7 +66,7 @@ Session::svc (void) } { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1); this->active_thread_count_--; if (this->more_work ()) { @@ -95,7 +95,7 @@ Session::start (const Test::Session_List &other_sessions) throw Test::No_Peers (); { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); if (this->running_) throw Test::Already_Running (); @@ -156,7 +156,7 @@ Session::echo_payload (const Test::Payload &the_payload) Test::Payload_var retval (new Test::Payload (the_payload)); { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, retval._retn ()); this->expected_messages_--; diff --git a/TAO/tests/Big_Twoways/Session.h b/TAO/tests/Big_Twoways/Session.h index becf16912e8..5c0934db301 100644 --- a/TAO/tests/Big_Twoways/Session.h +++ b/TAO/tests/Big_Twoways/Session.h @@ -55,7 +55,7 @@ private: private: /// Synchronize the internal state - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; /// Keep a reference to the Session_Control, this is used to report /// when the test finishes. diff --git a/TAO/tests/Big_Twoways/Session_Control.cpp b/TAO/tests/Big_Twoways/Session_Control.cpp index 98d2eaaa728..bd51595b39d 100644 --- a/TAO/tests/Big_Twoways/Session_Control.cpp +++ b/TAO/tests/Big_Twoways/Session_Control.cpp @@ -43,7 +43,7 @@ Session_Control::~Session_Control (void) void Session_Control::session_finished (CORBA::Boolean success) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); if (this->session_count_ == 0) { ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Big_Twoways/Session_Control.h b/TAO/tests/Big_Twoways/Session_Control.h index 2da60584c36..96a6d734e72 100644 --- a/TAO/tests/Big_Twoways/Session_Control.h +++ b/TAO/tests/Big_Twoways/Session_Control.h @@ -30,7 +30,7 @@ public: private: /// Synchronize the internal state - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; /// The type of test CORBA::ULong session_count_; diff --git a/TAO/tests/Big_Twoways/server.cpp b/TAO/tests/Big_Twoways/server.cpp index 58a57f25f74..bc505fd004a 100644 --- a/TAO/tests/Big_Twoways/server.cpp +++ b/TAO/tests/Big_Twoways/server.cpp @@ -131,7 +131,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "Building session list . . . ")); - Session_Control *session_control_impl; + Session_Control *session_control_impl = 0; ACE_NEW_RETURN (session_control_impl, Session_Control (peer_count), 1); @@ -170,7 +170,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } session_list[j]->start (other_sessions); - } ACE_DEBUG ((LM_DEBUG, "done.\n")); diff --git a/TAO/tests/Blocking_Sync_None/run_test.pl b/TAO/tests/Blocking_Sync_None/run_test.pl index 888b24f244e..18103dc751f 100755 --- a/TAO/tests/Blocking_Sync_None/run_test.pl +++ b/TAO/tests/Blocking_Sync_None/run_test.pl @@ -7,6 +7,13 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} $iorfile = PerlACE::LocalFile ("server.ior"); unlink $iorfile; @@ -14,12 +21,12 @@ unlink $iorfile; $status = 0; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level -o server.ior"); } else { - $SV = new PerlACE::Process ("server", "-o $iorfile"); + $SV = new PerlACE::Process ("server", "-ORBDebuglevel $debug_level -o $iorfile"); } -$CL = new PerlACE::Process ("client", " -k file://$iorfile"); +$CL = new PerlACE::Process ("client", "-ORBDebuglevel $debug_level -k file://$iorfile"); $SV->Spawn (); diff --git a/TAO/tests/Bug_1020_Basic_Regression/Echo.cpp b/TAO/tests/Bug_1020_Basic_Regression/Echo.cpp index 7a300a5db2e..05cf417b3a0 100644 --- a/TAO/tests/Bug_1020_Basic_Regression/Echo.cpp +++ b/TAO/tests/Bug_1020_Basic_Regression/Echo.cpp @@ -14,7 +14,7 @@ Echo::Echo(CORBA::ORB_ptr orb, void Echo::echo_payload (Test::Payload &) { - ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, + ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_)); diff --git a/TAO/tests/Bug_1020_Basic_Regression/Echo.h b/TAO/tests/Bug_1020_Basic_Regression/Echo.h index 55aed2b36df..03676f8ef74 100644 --- a/TAO/tests/Bug_1020_Basic_Regression/Echo.h +++ b/TAO/tests/Bug_1020_Basic_Regression/Echo.h @@ -25,7 +25,7 @@ private: int abort_counter_; - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; }; #endif /* BUG_1020_BASIC_REGRESSION_ECHO_H*/ diff --git a/TAO/tests/Bug_1361_Regression/Echo.h b/TAO/tests/Bug_1361_Regression/Echo.h index 59e08d6b754..c989dd2ca78 100644 --- a/TAO/tests/Bug_1361_Regression/Echo.h +++ b/TAO/tests/Bug_1361_Regression/Echo.h @@ -28,7 +28,7 @@ public: private: CORBA::ORB_var orb_; - ACE_Atomic_Op<ACE_SYNCH_MUTEX, int> abort_counter_; + ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> abort_counter_; }; #endif /* TAO_TESTS_BUG1270_ECHO_H*/ diff --git a/TAO/tests/Bug_1361_Regression/run_test.pl b/TAO/tests/Bug_1361_Regression/run_test.pl index 497722d829d..b77fb73e0b7 100755 --- a/TAO/tests/Bug_1361_Regression/run_test.pl +++ b/TAO/tests/Bug_1361_Regression/run_test.pl @@ -9,11 +9,12 @@ use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; use POSIX "sys_wait_h"; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile"); @@ -24,7 +25,7 @@ $CL = new PerlACE::Process ("client", "-k file://$iorfile -t $threads"); $SV->Spawn (); -if (PerlACE::waitforfile_timed ($iorfile, 250) == -1) { +if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: cannot find file <$iorfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; @@ -35,7 +36,7 @@ local $max_running_time = 360; local $elapsed = time() - $start_time; my $p = $SV->{'PROCESS'}; -while (($elapsed < $max_running_time) ) +while (($elapsed < $max_running_time) ) { # Start all clients in parallel $client = $CL->Spawn (); @@ -43,15 +44,15 @@ while (($elapsed < $max_running_time) ) $CL->WaitKill(60) unless $client < 0; print STDERR "checking server alive\n"; - + my $pid = waitpid ($SV->{PROCESS}, &WNOHANG); - - if ($pid != 0 && $? != -1) + + if ($pid != 0 && $? != -1) { $SV->check_return_value ($?); $server_died = 1; last; - } + } $elapsed = time() - $start_time; sleep (1); diff --git a/TAO/tests/Bug_1383_Regression/SimpleClient.cpp b/TAO/tests/Bug_1383_Regression/SimpleClient.cpp index 8208c7a5ae9..de2d75756f6 100644 --- a/TAO/tests/Bug_1383_Regression/SimpleClient.cpp +++ b/TAO/tests/Bug_1383_Regression/SimpleClient.cpp @@ -2,6 +2,7 @@ #include "tao/corba.h" #include "ace/OS_NS_unistd.h" +#include "ace/Thread.h" #include "simpleC.h" #include "Callee_i.h" #include "tao/IORManipulation/IORManip_Loader.h" diff --git a/TAO/tests/Bug_1551_Regression/run_test.pl b/TAO/tests/Bug_1551_Regression/run_test.pl index 34a54b73517..e5a0aec36bc 100755 --- a/TAO/tests/Bug_1551_Regression/run_test.pl +++ b/TAO/tests/Bug_1551_Regression/run_test.pl @@ -8,11 +8,12 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior -ORBdotteddecimaladdresses 1"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase -ORBdotteddecimaladdresses 1"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile -ORBdotteddecimaladdresses 1"); @@ -44,7 +45,6 @@ $client1 = $CL1->Spawn (); $client2 = $CL2->Spawn (); $client3 = $CL3->Spawn (); - sleep (30) if ($client1 == 0 && $client2 == 0 && $client3 == 0); $SV->WaitKill (3) unless $sv1 < 0; @@ -72,6 +72,4 @@ $n = $n + 1; unlink $iorfile; } - - exit $status; diff --git a/TAO/tests/Bug_1551_Regression/server.cpp b/TAO/tests/Bug_1551_Regression/server.cpp index b70aa044d03..e28f97a0e2f 100644 --- a/TAO/tests/Bug_1551_Regression/server.cpp +++ b/TAO/tests/Bug_1551_Regression/server.cpp @@ -4,6 +4,7 @@ #include "Server_Task.h" #include "tao/Utils/Servant_Var.h" #include "ace/Get_Opt.h" +#include "ace/High_Res_Timer.h" ACE_RCSID (Bug_1XXX_Regression, server, "$Id$") @@ -52,6 +53,14 @@ parse_args (int argc, char *argv[]) int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { + // Fetching the high res timer's global scale factor ensures that it + // is calibrated (if necessary on this platform) at the beginning of + // the test. While the timer would otherwise be calibrated on first + // use, this introduces delay in the middle of the test's execution. + // This leads to failures due to timing assumptions (timeouts, etc.) + // within the test itself. + (void) ACE_High_Res_Timer::global_scale_factor(); + try { CORBA::ORB_var orb = diff --git a/TAO/tests/Bug_2134_Regression/run_test.pl b/TAO/tests/Bug_2134_Regression/run_test.pl index 46e02e111e2..20363316932 100755 --- a/TAO/tests/Bug_2134_Regression/run_test.pl +++ b/TAO/tests/Bug_2134_Regression/run_test.pl @@ -10,9 +10,14 @@ use PerlACE::Run_Test; $status = 0; +if (PerlACE::is_vxworks_test()) { +$CL = new PerlACE::ProcessVX ("server", "-ORBObjRefStyle URL"); +} +else { $CL = new PerlACE::Process ("server", "-ORBObjRefStyle URL"); +} -$client = $CL->SpawnWaitKill (300); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/tests/Bug_2174_Regression/run_test.pl b/TAO/tests/Bug_2174_Regression/run_test.pl index 12f41476a9a..0c97124f055 100755 --- a/TAO/tests/Bug_2174_Regression/run_test.pl +++ b/TAO/tests/Bug_2174_Regression/run_test.pl @@ -8,13 +8,14 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; # Test A: object exists (_non_existent() returns false) if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile"); @@ -34,7 +35,7 @@ if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_cr exit 1; } -$client = $CL->SpawnWaitKill (15); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); $SV->Kill (); unlink $iorfile; if ($client != 2) { @@ -46,7 +47,7 @@ if ($client != 2) { # Test B: object does not exist (_non_existent() returns true) if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior -r"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase -r"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile -r"); @@ -59,7 +60,7 @@ if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_cr exit 1; } -$client = $CL->SpawnWaitKill (15); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); $SV->Kill (); if ($client != 3) { print STDERR "ERROR: client returned $client in test B, expected 3\n"; @@ -73,7 +74,7 @@ if ($client != 3) { # This test was failing on win32 without this sleep. sleep 1; -$client = $CL->SpawnWaitKill (15); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); unlink $iorfile; if ($client != 5) { print STDERR "ERROR: client returned $client in test C, expected 5\n"; diff --git a/TAO/tests/Bug_2183_Regression/run_test.pl b/TAO/tests/Bug_2183_Regression/run_test.pl index c8bd9248b1b..0b695f5d9c0 100755 --- a/TAO/tests/Bug_2183_Regression/run_test.pl +++ b/TAO/tests/Bug_2183_Regression/run_test.pl @@ -9,15 +9,14 @@ use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; # The server IOR file -$server_ior_file = PerlACE::LocalFile ("server.ior"); +$server_ior_file_base = "server.ior"; +$server_ior_file = PerlACE::LocalFile ("$server_ior_file_base"); # The client and server processes -if (PerlACE::is_vxworks_test()) { - $SERVER = new PerlACE::ProcessVX(PerlACE::LocalFile("server")); -} -else { - $SERVER = new PerlACE::Process(PerlACE::LocalFile("server")); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SERVER = new $class ("server"); + $perl_executable = $^X; $perl_executable =~ s/\.exe//ig; if ($^O == 'VMS') { @@ -30,7 +29,7 @@ $DUMMY_CLIENT->Arguments("hang_client.pl"); $DUMMY_CLIENT->IgnoreExeSubDir(1); if (PerlACE::is_vxworks_test()) { - $SERVER->Arguments("-o server.ior -ORBEndpoint iiop://:15000 -ORBSvcConf server.conf"); + $SERVER->Arguments("-o $server_ior_file_base -ORBEndpoint iiop://:15000 -ORBSvcConf server.conf"); } else { $SERVER->Arguments("-o $server_ior_file -ORBEndpoint iiop://:15000 -ORBSvcConf server.conf"); diff --git a/TAO/tests/Bug_2234_Regression/Test.idl b/TAO/tests/Bug_2234_Regression/Test.idl index 5843ece7d9e..662cfb2e660 100644 --- a/TAO/tests/Bug_2234_Regression/Test.idl +++ b/TAO/tests/Bug_2234_Regression/Test.idl @@ -26,6 +26,8 @@ module Test typedef sequence< long > MySeqOfLong; + typedef MySeqOfLong MyArray[2]; + interface Foo { long TestLong( in long a, out long b, inout long c ); @@ -36,6 +38,8 @@ module Test MyVarUnion TestVarUnion( in MyVarUnion a, out MyVarUnion b, inout MyVarUnion c ); MySeqOfLong TestSeqOfLong( in MySeqOfLong a, out MySeqOfLong b, inout MySeqOfLong c ); any TestAny( in any a, out any b, inout any c ); + MyArray TestArray( in MyArray a, out MyArray b, inout MyArray c ); + Object TestObject( in Object a, out Object b, inout Object c); oneway void ShutdownServer(); }; }; diff --git a/TAO/tests/Bug_2234_Regression/client.cpp b/TAO/tests/Bug_2234_Regression/client.cpp index a2acf0a3f37..50b720cf485 100644 --- a/TAO/tests/Bug_2234_Regression/client.cpp +++ b/TAO/tests/Bug_2234_Regression/client.cpp @@ -284,6 +284,61 @@ main( ACE_DEBUG( (LM_INFO, "OK\n") ); //----------------------------------------------------------------------- + { + Test::MyArray arr_a; + arr_a[0].length (1); + arr_a[0][0] = 9; + arr_a[1].length (1); + arr_a[1][0] = 23; + + Test::MyArray_var arr_b; + + Test::MyArray arr_c; + arr_c[0].length (1); + arr_c[0][0] = 23; + arr_c[1].length (1); + arr_c[1][0] = 9; + + ACE_DEBUG( (LM_INFO, ". MyArray() ") ); + Test::MyArray_var arr_ret = foo->TestArray (arr_a, arr_b.out (), arr_c); + CORBA::ULong zero (0), one (1); //Use ULong to avoid ambiguity + if (arr_c[0].length () != 1 || arr_c[0][0] != 24) + { + ACE_DEBUG( (LM_ERROR, "arr_c[0] is wrong\n") ); testFailed = 1; + } + else if (arr_c[1].length () != 1 || arr_c[1][0] != 10) + { + ACE_DEBUG( (LM_ERROR, "arr_c[1] is wrong\n") ); testFailed = 1; + } + else if (arr_b[zero].length () != 1 || arr_b[zero][0] != 8) + { + ACE_DEBUG( (LM_ERROR, "arr_b[0] is wrong\n") ); testFailed = 1; + } + else if (arr_b[one].length () != 1 || arr_b[one][0] != 22) + { + ACE_DEBUG( (LM_ERROR, "arr_b[1] is wrong\n") ); testFailed = 1; + } + else if (arr_ret[zero].length () != 1 || arr_ret[zero][0] != 7) + { + ACE_DEBUG( (LM_ERROR, "arr_ret[0] is wrong\n") ); testFailed = 1; + } + else if (arr_ret[one].length () != 1 || arr_ret[one][0] != 21) + { + ACE_DEBUG( (LM_ERROR, "arr_ret[1] is wrong\n") ); testFailed = 1; + } + else + ACE_DEBUG( (LM_INFO, "OK\n") ); + } + + //----------------------------------------------------------------------- + { + CORBA::Object_var a = CORBA::Object::_duplicate (foo); + CORBA::Object_var b; + CORBA::Object_var c = CORBA::Object::_duplicate (a); + CORBA::Object_var ret = foo->TestObject (a.in (), b.out (), c.inout ()); + } + + //----------------------------------------------------------------------- foo->ShutdownServer( ); //----------------------------------------------------------------------- diff --git a/TAO/tests/Bug_2234_Regression/run_test.pl b/TAO/tests/Bug_2234_Regression/run_test.pl index c3cd6960c5d..0ed4fa01026 100755 --- a/TAO/tests/Bug_2234_Regression/run_test.pl +++ b/TAO/tests/Bug_2234_Regression/run_test.pl @@ -14,14 +14,11 @@ $server_ior_file= PerlACE::LocalFile( "server.ior" ); unlink $server_ior_file; # The client and server processes -if (PerlACE::is_vxworks_test()) { - $SERVER= new PerlACE::ProcessVX( PerlACE::LocalFile( "server" ) ); -} -else { - $SERVER= new PerlACE::Process( PerlACE::LocalFile( "server" ) ); -} -$CLIENT= new PerlACE::Process( PerlACE::LocalFile( "client" ) ); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SERVER = new $class ("server"); +$CLIENT= new PerlACE::Process( PerlACE::LocalFile( "client" ) ); # Fire up the server $sv = $SERVER->Spawn(); @@ -47,7 +44,7 @@ if ($CLIENT->SpawnWaitKill( 30 ) != 0) } unlink $server_ior_file; -if ($SERVER->WaitKill( 1 ) != 0) +if ($SERVER->WaitKill( 15 ) != 0) { print STDERR "ERROR: Bug #2234 Regression test failed: server not exiting.\n"; exit 1; diff --git a/TAO/tests/Bug_2234_Regression/server.cpp b/TAO/tests/Bug_2234_Regression/server.cpp index 4f4bd992438..ac0e36fd044 100644 --- a/TAO/tests/Bug_2234_Regression/server.cpp +++ b/TAO/tests/Bug_2234_Regression/server.cpp @@ -419,6 +419,86 @@ public: //----------------------------------------------------------- + Test::MyArray_slice *TestArray( + const Test::MyArray a, + Test::MyArray_out b, + Test::MyArray c) + { + ACE_DEBUG( (LM_INFO, ". in TestArray\n") ); + if (a[0].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter a[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[0][0] != 9) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter a[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[1].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter a[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (a[1][0] != 23) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter a[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + + if (c[0].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter c[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[0][0]++ != 23) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter c[0]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[1].length () != 1) + { + ACE_DEBUG( (LM_INFO, "* Incorrect length of parameter c[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + if (c[1][0]++ != 9) + { + ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter c[1]\n") ); + throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO); + } + + b = Test::MyArray_alloc (); + CORBA::ULong idx (0); + b[idx].length (1); + b[idx][0] = 8; + ++idx; + b[idx].length (1); + b[idx][0] = 22; + + Test::MyArray_var ret = new Test::MyArray; + idx = 0; + ret[idx].length (1); + ret[idx][0] = 7; + ++idx; + ret[idx].length (1); + ret[idx][0] = 21; + return ret._retn (); + } + + //----------------------------------------------------------- + + CORBA::Object_ptr TestObject( + CORBA::Object_ptr a, + CORBA::Object_out b, + CORBA::Object_ptr &c + ) + { + b = CORBA::Object::_duplicate (a); + return CORBA::Object::_duplicate (c); + } + + //----------------------------------------------------------- + void ShutdownServer( ) { @@ -459,6 +539,8 @@ public: const Test::MyVarUnion *vU; const Test::MyNonVarUnion *fU; const Test::MySeqOfLong *sL; + Test::MyArray_forany arr; + CORBA::Object_var obj; if (arg >>= vS) { @@ -554,6 +636,19 @@ public: else ACE_DEBUG( (LM_INFO, "*Null*") ); } + else if (arg >>= arr) + { + ACE_DEBUG( (LM_INFO, "MyArray (") ); + for (CORBA::ULong a_idx = 0; a_idx < 2; ++a_idx) + { + CORBA::ULong length = arr[a_idx].length (); + ACE_DEBUG( (LM_INFO, "[%u].length () == %u ", a_idx, length)); + } + } + else if (arg >>= CORBA::Any::to_object(obj)) + { + ACE_DEBUG( (LM_INFO, "CORBA::Object (") ); + } else ACE_DEBUG( (LM_INFO, "Unknown (") ); ACE_DEBUG( (LM_INFO, ") parameter\n") ); diff --git a/TAO/tests/Bug_2289_Regression/run_test.pl b/TAO/tests/Bug_2289_Regression/run_test.pl index c3b9fc9eb71..bdb1bfef6e6 100755 --- a/TAO/tests/Bug_2289_Regression/run_test.pl +++ b/TAO/tests/Bug_2289_Regression/run_test.pl @@ -17,10 +17,12 @@ unlink $client_ior_file; # The client and server processes if (PerlACE::is_vxworks_test()) { - $SERVER = new PerlACE::ProcessVX("server"); + $SERVER = new PerlACE::ProcessVX("server"); + $TARGETHOSTNAME = $ENV{'ACE_RUN_VX_TGTHOST'}; } else { - $SERVER = new PerlACE::Process("server"); + $SERVER = new PerlACE::Process("server"); + $TARGETHOSTNAME = "127.0.0.1"; } $CLIENT = new PerlACE::Process("client"); @@ -45,7 +47,7 @@ if (PerlACE::waitforfile_timed ($server_ior_file, $PerlACE::wait_interval_for_pr exit 1; } -$CLIENT->Arguments("-k corbaloc::127.0.0.1:$port/collocated_ior_bound_in_remote_iortable -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa"); +$CLIENT->Arguments("-k corbaloc::$TARGETHOSTNAME:$port/collocated_ior_bound_in_remote_iortable -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa"); if ($CLIENT->SpawnWaitKill (60) != 0) { print STDERR "ERROR: Bug 2289 Regression failed. Non zero result from client.\n"; @@ -54,7 +56,7 @@ if ($CLIENT->SpawnWaitKill (60) != 0) } # Clean up and return -$SERVER->TerminateWaitKill (5); +$SERVER->TerminateWaitKill (15); unlink $server_ior_file; unlink $client_ior_file; exit 0; diff --git a/TAO/tests/Bug_2319_Regression/run_test.pl b/TAO/tests/Bug_2319_Regression/run_test.pl index 3f6ccefdb04..76a29d0638c 100755 --- a/TAO/tests/Bug_2319_Regression/run_test.pl +++ b/TAO/tests/Bug_2319_Regression/run_test.pl @@ -10,12 +10,14 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$AMH = new PerlACE::Process ("server", ""); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$AMH = new $class ("server"); # Run the AMH server. $AMH->Spawn (); -$amhserver= $AMH->WaitKill (60); +$amhserver= $AMH->WaitKill ($PerlACE::wait_interval_for_process_creation); if ($amhserver != 0) { print STDERR "ERROR: AMH Server returned $amhserver\n"; $status = 1; diff --git a/TAO/tests/Bug_2328_Regression/run_test.pl b/TAO/tests/Bug_2328_Regression/run_test.pl index a1bb988ec23..3a03a5bac3c 100755 --- a/TAO/tests/Bug_2328_Regression/run_test.pl +++ b/TAO/tests/Bug_2328_Regression/run_test.pl @@ -10,17 +10,18 @@ use PerlACE::Run_Test; $status = 0; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile"); } $CL = new PerlACE::Process ("client", " -k file://$iorfile -ORBNegotiateCodesets 0"); - + $SV->Spawn (); if (PerlACE::waitforfile_timed ($iorfile, @@ -28,7 +29,7 @@ if (PerlACE::waitforfile_timed ($iorfile, print STDERR "ERROR: cannot find file <$iorfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; -} +} $client = $CL->SpawnWaitKill (300); @@ -37,7 +38,7 @@ if ($client != 0) { $status = 1; } -$server = $SV->WaitKill (10); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Bug_2345_Regression/run_test.pl b/TAO/tests/Bug_2345_Regression/run_test.pl index af993694fbe..d8461382809 100755 --- a/TAO/tests/Bug_2345_Regression/run_test.pl +++ b/TAO/tests/Bug_2345_Regression/run_test.pl @@ -10,9 +10,14 @@ use PerlACE::Run_Test; $status = 0; +if (PerlACE::is_vxworks_test()) { +$SV = new PerlACE::ProcessVX ("server", "-ORBUseIMR 1 -ORBDefaultInitRef corbaloc:iiop:localhost:12345"); +} +else { $SV = new PerlACE::Process ("server", "-ORBUseIMR 1 -ORBDefaultInitRef corbaloc:iiop:localhost:12345"); +} -$server = $SV->SpawnWaitKill (30); +$server = $SV->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Bug_2417_Regression/publisher_impl.cpp b/TAO/tests/Bug_2417_Regression/publisher_impl.cpp index 5af6ae7ded9..87e84cd8eda 100644 --- a/TAO/tests/Bug_2417_Regression/publisher_impl.cpp +++ b/TAO/tests/Bug_2417_Regression/publisher_impl.cpp @@ -27,7 +27,7 @@ public: private: bool terminated; vector<_Subscriber> subscribers; - ACE_Thread_Mutex mutex; + TAO_SYNCH_MUTEX mutex; Publisher_impl * owner; }; @@ -44,7 +44,7 @@ Publisher_impl::Worker::~Worker() void Publisher_impl::Worker::addSubscriber(Subscriber_ptr subscriber) { - ACE_Guard<ACE_Thread_Mutex> guard(mutex); + ACE_Guard<TAO_SYNCH_MUTEX> guard(mutex); subscribers.push_back(_Subscriber()); _Subscriber& s = subscribers.back(); s.unsubscribed = false; @@ -64,7 +64,7 @@ int Publisher_impl::Worker::svc (void) data += 0.01; ++iteration; { - ACE_Guard<ACE_Thread_Mutex> guard(mutex); + ACE_Guard<TAO_SYNCH_MUTEX> guard(mutex); doShutdown = subscribers.size() > 0; for (vector<_Subscriber>::iterator iter = subscribers.begin(); iter != subscribers.end(); ++iter) @@ -89,7 +89,7 @@ int Publisher_impl::Worker::svc (void) } if (iteration % 200 == 0) { - ACE_Guard<ACE_Thread_Mutex> guard(mutex); + ACE_Guard<TAO_SYNCH_MUTEX> guard(mutex); for (vector<_Subscriber>::iterator iter = subscribers.begin(); iter != subscribers.end(); ++iter) { diff --git a/TAO/tests/Bug_2429_Regression/run_test.pl b/TAO/tests/Bug_2429_Regression/run_test.pl index 610946f71d2..55917686742 100755 --- a/TAO/tests/Bug_2429_Regression/run_test.pl +++ b/TAO/tests/Bug_2429_Regression/run_test.pl @@ -16,7 +16,7 @@ unlink $server_ior_file; # The client and server processes if (PerlACE::is_vxworks_test()) { - $SERVER = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SERVER = new PerlACE::ProcessVX ("server", "-o $plain_server_ior_file"); } else { $SERVER = new PerlACE::Process ("server", "-o $server_ior_file"); diff --git a/TAO/tests/Bug_2503_Regression/server.cpp b/TAO/tests/Bug_2503_Regression/server.cpp index 9e21ae43695..204bbf8a284 100644 --- a/TAO/tests/Bug_2503_Regression/server.cpp +++ b/TAO/tests/Bug_2503_Regression/server.cpp @@ -4,6 +4,7 @@ #include "common.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" +#include "ace/High_Res_Timer.h" void parse_args(int argc, char * argv[]); void write_ior_to_file(char const * ior); @@ -11,6 +12,14 @@ void write_ior_to_file(char const * ior); int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { + // Fetching the high res timer's global scale factor ensures that it + // is calibrated (if necessary on this platform) at the beginning of + // the test. While the timer would otherwise be calibrated on first + // use, this introduces delay in the middle of the test's execution. + // This leads to failures due to timing assumptions (timeouts, etc.) + // within the test itself. + (void) ACE_High_Res_Timer::global_scale_factor(); + try { CORBA::ORB_var orb = initialize_orb_and_poa(argc, argv); diff --git a/TAO/tests/Bug_2654_Regression/Hello.cpp b/TAO/tests/Bug_2654_Regression/Hello.cpp index 15de800ac23..d99b2077260 100644 --- a/TAO/tests/Bug_2654_Regression/Hello.cpp +++ b/TAO/tests/Bug_2654_Regression/Hello.cpp @@ -43,7 +43,7 @@ Hello::method (CORBA::Short count) { if (++this->count_ > 10) { - ACE_DEBUG ((LM_DEBUG, "{%P| %t) supplied count = %d\n", count)); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) supplied count = %d\n", count)); PortableServer::POA_var poa = this->_default_POA(); PortableServer::POAManager_var mgr = poa->the_POAManager(); mgr->hold_requests(false); diff --git a/TAO/tests/Bug_2677_Regression/server.cpp b/TAO/tests/Bug_2677_Regression/server.cpp index 8bf889856a6..bcfdd64fc62 100644 --- a/TAO/tests/Bug_2677_Regression/server.cpp +++ b/TAO/tests/Bug_2677_Regression/server.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/OS.h" #include "ace/Service_Config.h" +#include "ace/Log_Msg.h" int ACE_TMAIN(int, ACE_TCHAR *[]) diff --git a/TAO/tests/Bug_2734_Regression/Bug_2734_Regression.mpc b/TAO/tests/Bug_2734_Regression/Bug_2734_Regression.mpc new file mode 100644 index 00000000000..0c95ddf25e6 --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/Bug_2734_Regression.mpc @@ -0,0 +1,31 @@ +// -*- MPC -*- +// $Id$ + +project(*idl): taoidldefaults { + IDL_Files { + test.idl + } + custom_only = 1 +} + +project(*Server): taoserver { + after += *idl + Source_Files { + testC.cpp + testS.cpp + test_i.cpp + server.cpp + } + IDL_Files { + } +} + +project(*Client): taoclient, messaging { + after += *idl + Source_Files { + testC.cpp + client.cpp + } + IDL_Files { + } +} diff --git a/TAO/tests/Bug_2734_Regression/client.cpp b/TAO/tests/Bug_2734_Regression/client.cpp new file mode 100644 index 00000000000..5df70515d89 --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/client.cpp @@ -0,0 +1,264 @@ +// $Id$ + +#include "testC.h" + +#include "tao/Messaging/Messaging.h" +#include "tao/AnyTypeCode/Any.h" +#include "ace/Get_Opt.h" + +ACE_RCSID(Timeout, client, "$Id$") + +const char *ior = "file://test.ior"; +int min_timeout = 0; +int max_timeout = 20; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:l:h:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + + case 'l': + min_timeout = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case 'h': + max_timeout = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-l <min_timeout> " + "-h <max_timeout> " + "\n", + argv [0]), + -1); + } + // Indicates successful parsing of the command line + return 0; +} + +enum TO_TYPE {none = 0, orb1 = 1, thread1 = 2, object1 = 3}; +const char *to_type_names[4] ={"none", "orb", "thread", "object"}; + +static int timeout_count[4] = {0, 0, 0, 0}; +static int in_time_count[4] = {0, 0, 0, 0}; + +void +send_echo (TO_TYPE ctype, CORBA::ORB_ptr orb, + Simple_Server_ptr server, + CORBA::Long t) +{ + try + { + server->echo (0, t); + + in_time_count[ctype]++; + } + catch (const CORBA::TIMEOUT& ) + { + timeout_count[ctype]++; + + // Trap this exception and continue... + ACE_DEBUG ((LM_DEBUG, + "==> Trapped a TIMEOUT exception (expected)\n")); + + // Sleep so the server can send the reply... + ACE_Time_Value tv (max_timeout / 1000, // max_timeout is in msec, so get seconds + (max_timeout % 1000) * 1000); // and usec + + // This is a non-standard TAO call that's used to give the + // client ORB a chance to cleanup the reply that's come back + // from the server. + orb->run (tv); + } +} + + +int main (int argc, char* argv[]) +{ + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var object = + orb->string_to_object (ior); + + Simple_Server_var server = + Simple_Server::_narrow (object.in ()); + + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Object reference <%s> is nil\n", + ior), + 1); + } + + object = + orb->resolve_initial_references ("ORBPolicyManager"); + + CORBA::PolicyManager_var policy_manager = + CORBA::PolicyManager::_narrow (object.in ()); + + object = + orb->resolve_initial_references ("PolicyCurrent"); + + CORBA::PolicyCurrent_var policy_current = + CORBA::PolicyCurrent::_narrow (object.in ()); + + TimeBase::TimeT mid_value = + 10000 * (min_timeout + max_timeout) / 2; // convert from msec to "TimeT" (0.1 usec units) + + CORBA::Any any_orb; + any_orb <<= mid_value; + CORBA::Any any_thread; + any_thread <<= mid_value + 10000; // midvalue + 1 msec + CORBA::Any any_object; + any_object <<= mid_value + 20000; // midvalue + 2 msec + + CORBA::PolicyList policy_list (1); + policy_list.length (1); + policy_list[0] = + orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, + any_object); + object = + server->_set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + + Simple_Server_var timeout_server = + Simple_Server::_narrow (object.in ()); + + policy_list[0]->destroy (); + policy_list[0] = CORBA::Policy::_nil (); + + ACE_DEBUG ((LM_DEBUG, + "client (%P) testing from %d to %d milliseconds\n", + min_timeout, max_timeout)); + + for (CORBA::Long t = min_timeout; t < max_timeout; ++t) + { + ACE_DEBUG ((LM_DEBUG, + "\n================================\n" + "Trying with timeout = %d msec\n", t)); + + ACE_DEBUG ((LM_DEBUG, + "Cleanup ORB/Thread/Object policies\n")); + + policy_list.length (0); + policy_manager->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + policy_current->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + + send_echo (none, orb.in (), server.in (), t); + + + + + ACE_DEBUG ((LM_DEBUG, + "client(%P) Set the ORB policies\n")); + + policy_list.length (1); + policy_list[0] = + orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, + any_orb); + + policy_manager->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + + send_echo (orb1, orb.in (), server.in (), t); + + policy_list[0]->destroy (); + + + + + + + + ACE_DEBUG ((LM_DEBUG, + "client(%P) Set the thread policies\n")); + + policy_list.length (1); + policy_list[0] = + orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, + any_thread); + + policy_current->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + + send_echo (thread1, orb.in (), server.in (), t); + + policy_list[0]->destroy (); + + + + + + + + ACE_DEBUG ((LM_DEBUG, + "client(%P) Use the object policies\n")); + send_echo (object1, orb.in (), timeout_server.in (), t); + } + + ACE_DEBUG ((LM_DEBUG, + "\n\n\nclient(%P) Test completed, " + "resynch with server\n")); + policy_list.length (0); + policy_manager->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + policy_current->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE); + + send_echo (none, orb.in (), server.in (), 0); + + server->shutdown (); + + int timeout_count_total = 0; + int in_time_count_total = 0; + for (int i = 0; i < 4; i++) { + timeout_count_total += timeout_count[i]; + in_time_count_total += in_time_count[i]; + ACE_DEBUG ((LM_DEBUG, "in_time_count[%s]= %d timeout_count[%s]= %d\n", + to_type_names[i], in_time_count[i], + to_type_names[i], timeout_count[i])); + } + + if (timeout_count_total == 0) + ACE_ERROR ((LM_ERROR, + "ERROR: No messages timed out\n")); + + //FUZZ: disable check_for_lack_ACE_OS + if (in_time_count_total == 0) + ACE_ERROR ((LM_ERROR, + "ERROR: No messages on time (within time limit)\n")); + //FUZZ: enable check_for_lack_ACE_OS + + ACE_DEBUG ((LM_DEBUG, "in_time_count_total = %d, timeout_count_total = %d\n", + in_time_count_total, timeout_count_total)); + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + return 0; +} diff --git a/TAO/tests/Bug_2734_Regression/run_test.pl b/TAO/tests/Bug_2734_Regression/run_test.pl index c0a65a695e2..5ba81f03fa1 100755 --- a/TAO/tests/Bug_2734_Regression/run_test.pl +++ b/TAO/tests/Bug_2734_Regression/run_test.pl @@ -9,13 +9,12 @@ use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; use strict; -my $base_test = '../Timeout'; my $status = 0; my $iorfile = 'server.ior'; my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : 'PerlACE::Process'); -my $SV = $class->new("$base_test/server", "-o $iorfile"); -my $CL = new PerlACE::Process("$base_test/client", +my $SV = $class->new("server", "-o $iorfile"); +my $CL = new PerlACE::Process("client", "-ORBid ClientORB -k file://$iorfile " . "-l 35 -h 40"); diff --git a/TAO/tests/Bug_2734_Regression/server.cpp b/TAO/tests/Bug_2734_Regression/server.cpp new file mode 100644 index 00000000000..3aac50dee20 --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/server.cpp @@ -0,0 +1,103 @@ +// $Id$ + +#include "test_i.h" +#include "ace/Get_Opt.h" +#include "ace/OS_NS_stdio.h" + +ACE_RCSID(Timeout, server, "$Id$") + +const char *ior_output_file = 0; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "o:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "\n", + argv [0]), + -1); + } + + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + Simple_Server_i server_impl (orb.in ()); + + PortableServer::ObjectId_var id = + root_poa->activate_object (&server_impl); + + CORBA::Object_var object = root_poa->id_to_reference (id.in ()); + + Simple_Server_var server = + Simple_Server::_narrow (object.in ()); + + CORBA::String_var ior = + orb->object_to_string (server.in ()); + + // ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); + + // If the ior_output_file exists, output the ior to it + if (ior_output_file != 0) + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + } + + poa_manager->activate (); + + orb->run (); + + // ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught exception:"); + return 1; + } + return 0; +} diff --git a/TAO/tests/Bug_2734_Regression/test.idl b/TAO/tests/Bug_2734_Regression/test.idl new file mode 100644 index 00000000000..5481e3f26f0 --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/test.idl @@ -0,0 +1,12 @@ +// +// $Id$ +// + +interface Simple_Server { + + /// Returns <x>, but sleep for <msecs> milliseconds before returning + long echo (in long x, in long msecs); + + /// Shutdown the ORB + oneway void shutdown (); +}; diff --git a/TAO/tests/Bug_2734_Regression/test_i.cpp b/TAO/tests/Bug_2734_Regression/test_i.cpp new file mode 100644 index 00000000000..e75b0e611ce --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/test_i.cpp @@ -0,0 +1,45 @@ +// $Id$ + +#include "test_i.h" +#include "ace/OS_NS_unistd.h" +#include "ace/High_Res_Timer.h" + +ACE_RCSID(Timeout, test_i, "$Id$") + +ACE_High_Res_Timer sleep_duration; + + +Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb) + : orb_ (CORBA::ORB::_duplicate (orb)) +{ + sleep_duration.calibrate(); +} + +CORBA::Long +Simple_Server_i::echo (CORBA::Long x, + CORBA::Long msecs) +{ + ACE_Time_Value tv (msecs / 1000, (msecs % 1000) * 1000); + + ACE_DEBUG ((LM_DEBUG, "server (%P) will request sleep for %d sec and %d msecs.\n", + tv.sec(), tv.msec ())); + + sleep_duration.reset(); + sleep_duration.start(); + ACE_OS::sleep (tv); + sleep_duration.stop(); + ACE_hrtime_t usec; + sleep_duration.elapsed_microseconds(usec); + ACE_DEBUG ((LM_DEBUG, "server (%P) actually slept for %d sec and %d msecs.\n", + usec/1000000, (usec % 1000000)/1000)); + + return x; +} + +void +Simple_Server_i::shutdown (void) +{ + ACE_DEBUG ((LM_DEBUG, + "server (%P) Received shutdown request from client\n")); + this->orb_->shutdown (0); +} diff --git a/TAO/tests/Bug_2734_Regression/test_i.h b/TAO/tests/Bug_2734_Regression/test_i.h new file mode 100644 index 00000000000..8c102e3a1b7 --- /dev/null +++ b/TAO/tests/Bug_2734_Regression/test_i.h @@ -0,0 +1,43 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO/tests/Timeout +// +// = FILENAME +// test_i.h +// +// = AUTHOR +// Carlos O'Ryan +// +// ============================================================================ + +#ifndef TAO_TIMEOUT_TEST_I_H +#define TAO_TIMEOUT_TEST_I_H + +#include "testS.h" + +class Simple_Server_i : public POA_Simple_Server +{ + // = TITLE + // Simpler Server implementation + // + // = DESCRIPTION + // Implements the Simple_Server interface in test.idl + // +public: + Simple_Server_i (CORBA::ORB_ptr orb); + // ctor + + // = The Simple_Server methods. + CORBA::Long echo (CORBA::Long x, + CORBA::Long msecs); + void shutdown (void); + +private: + CORBA::ORB_var orb_; + // The ORB +}; + +#endif /* TAO_TIMEOUT_TEST_I_H */ diff --git a/TAO/tests/Bug_2735_Regression/server.cpp b/TAO/tests/Bug_2735_Regression/server.cpp index 46cd8638c98..5fa0f1e4591 100644 --- a/TAO/tests/Bug_2735_Regression/server.cpp +++ b/TAO/tests/Bug_2735_Regression/server.cpp @@ -3,6 +3,7 @@ #include "tao/ORB.h" #include "ace/Get_Opt.h" #include "ace/Service_Config.h" +#include "ace/Log_Msg.h" ACE_RCSID (Bug_2735_Regression, server, diff --git a/TAO/tests/Bug_2792_Regression/run_test.pl b/TAO/tests/Bug_2792_Regression/run_test.pl index 92b78a0b270..3ac7a1623bc 100755 --- a/TAO/tests/Bug_2792_Regression/run_test.pl +++ b/TAO/tests/Bug_2792_Regression/run_test.pl @@ -10,9 +10,11 @@ use PerlACE::Run_Test; $status = 0; -$CL = new PerlACE::Process ("client", ""); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$CL = new $class ("client"); -$client = $CL->SpawnWaitKill (150); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/tests/Bug_2795_Regression/run_test.pl b/TAO/tests/Bug_2795_Regression/run_test.pl index 92b78a0b270..3ac7a1623bc 100755 --- a/TAO/tests/Bug_2795_Regression/run_test.pl +++ b/TAO/tests/Bug_2795_Regression/run_test.pl @@ -10,9 +10,11 @@ use PerlACE::Run_Test; $status = 0; -$CL = new PerlACE::Process ("client", ""); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$CL = new $class ("client"); -$client = $CL->SpawnWaitKill (150); +$client = $CL->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/tests/Bug_2804_Regression/run_test.pl b/TAO/tests/Bug_2804_Regression/run_test.pl index 929281e6f9b..8def363eca2 100755 --- a/TAO/tests/Bug_2804_Regression/run_test.pl +++ b/TAO/tests/Bug_2804_Regression/run_test.pl @@ -10,13 +10,14 @@ use PerlACE::Run_Test; $status = 0; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; print STDERR "\n\n==== Bug 2804_Regression\n"; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile"); diff --git a/TAO/tests/Bug_2805_Regression/client.cpp b/TAO/tests/Bug_2805_Regression/client.cpp index 18fc6160d94..96cff6b785e 100644 --- a/TAO/tests/Bug_2805_Regression/client.cpp +++ b/TAO/tests/Bug_2805_Regression/client.cpp @@ -28,7 +28,7 @@ const char *ior = "file://test.ior"; int nthreads = 5; int niterations = 5; int debug = 0; -ACE_Atomic_Op<ACE_SYNCH_MUTEX, int> number_of_replies = 0; +ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> number_of_replies = 0; CORBA::Long in_number = 931232; const char * in_str = "Let's talk AMI."; diff --git a/TAO/tests/Bug_2809_Regression/run_test.pl b/TAO/tests/Bug_2809_Regression/run_test.pl index df7ee0e2a80..9db239743a1 100755 --- a/TAO/tests/Bug_2809_Regression/run_test.pl +++ b/TAO/tests/Bug_2809_Regression/run_test.pl @@ -17,9 +17,11 @@ foreach $i (@ARGV) { } } -$SV = new PerlACE::Process ("server", ""); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$T = new $class ("server"); -$server = $SV->SpawnWaitKill (30); +$server = $T->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Bug_2869_Regression/run_test.pl b/TAO/tests/Bug_2869_Regression/run_test.pl index f0d1b317487..aebc7b202cc 100755 --- a/TAO/tests/Bug_2869_Regression/run_test.pl +++ b/TAO/tests/Bug_2869_Regression/run_test.pl @@ -13,12 +13,9 @@ $status = 0; $iorfile = PerlACE::LocalFile ("test.ior"); unlink $iorfile; -if (PerlACE::is_vxworks_test()) { - $CL = new PerlACE::ProcessVX ("client", ""); -} -else { - $CL = new PerlACE::Process ("client", ""); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$CL = new $class ("client"); $client = $CL->Spawn (); @@ -34,7 +31,7 @@ if (PerlACE::waitforfile_timed ($iorfile, exit 1; } -$client = $CL->WaitKill (10); +$client = $CL->WaitKill (15); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/tests/Bug_2909_Regression/client.cpp b/TAO/tests/Bug_2909_Regression/client.cpp index cd51d4f79a0..942f7ab40e6 100644 --- a/TAO/tests/Bug_2909_Regression/client.cpp +++ b/TAO/tests/Bug_2909_Regression/client.cpp @@ -27,7 +27,7 @@ const char *ior = "file://test.ior"; int nthreads = 1; int niterations = 2; int debug = 0; -ACE_Atomic_Op<ACE_SYNCH_MUTEX, int> number_of_replies = 0; +ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> number_of_replies = 0; int invalid_exception = 0; diff --git a/TAO/tests/Bug_2935_Regression/run_test.pl b/TAO/tests/Bug_2935_Regression/run_test.pl index fe5db086431..d79b21073be 100755 --- a/TAO/tests/Bug_2935_Regression/run_test.pl +++ b/TAO/tests/Bug_2935_Regression/run_test.pl @@ -21,9 +21,11 @@ sub count_matching_lines { } $status = 0; -$sinkiorfile = PerlACE::LocalFile ("sink.ior"); +$sinkiorfilebase = "sink.ior"; +$sinkiorfile = PerlACE::LocalFile ("$sinkiorfilebase"); $middleiorfile = PerlACE::LocalFile ("middle.ior"); -$sinklogfile = PerlACE::LocalFile ("sink.log"); +$sinklogfilebase = "sink.log"; +$sinklogfile = PerlACE::LocalFile ("$sinklogfilebase"); $middlelogfile = PerlACE::LocalFile ("middle.log"); $sourcelogfile = PerlACE::LocalFile ("source.log"); @@ -33,7 +35,12 @@ unlink $sinklogfile; unlink $middlelogfile; unlink $sourcelogfile; +if (PerlACE::is_vxworks_test()) { +$SV = new PerlACE::ProcessVX ("sink", "-o $sinkiorfilebase -orblogfile $sinklogfilebase -orbdebuglevel 9"); +} +else { $SV = new PerlACE::Process ("sink", "-o $sinkiorfile -orblogfile $sinklogfile -orbdebuglevel 9"); +} $MD = new PerlACE::Process ("middle", "-o $middleiorfile -f $sinkiorfile -ORBSvcConf middle.conf -orblogfile $middlelogfile -orbdebuglevel 9"); $CL = new PerlACE::Process ("source", "-f $middleiorfile -orblogfile $sourcelogfile -orbdebuglevel 9"); diff --git a/TAO/tests/Bug_2936_Regression/bug2936.cpp b/TAO/tests/Bug_2936_Regression/bug2936.cpp index 24e2d735f81..6660cac066d 100644 --- a/TAO/tests/Bug_2936_Regression/bug2936.cpp +++ b/TAO/tests/Bug_2936_Regression/bug2936.cpp @@ -2,6 +2,7 @@ #include "ace/OS.h" #include "ace/Service_Config.h" +#include "ace/Log_Msg.h" char const * const scpc_orbId = "testDllOrb"; diff --git a/TAO/tests/Bug_2936_Regression/run_test.pl b/TAO/tests/Bug_2936_Regression/run_test.pl index c184856066e..7dc2e848fb5 100755 --- a/TAO/tests/Bug_2936_Regression/run_test.pl +++ b/TAO/tests/Bug_2936_Regression/run_test.pl @@ -13,12 +13,9 @@ $file = PerlACE::LocalFile ("test.ior"); unlink $file; -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("bug2936", ""); -} -else { - $SV = new PerlACE::Process ("bug2936", ""); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SV = new $class ("bug2936"); print STDERR "\n\n==== Running bug 2936 regression test\n"; diff --git a/TAO/tests/Bug_2953_Regression/run_test.pl b/TAO/tests/Bug_2953_Regression/run_test.pl index 78d81d7afa1..26bf017d285 100755 --- a/TAO/tests/Bug_2953_Regression/run_test.pl +++ b/TAO/tests/Bug_2953_Regression/run_test.pl @@ -24,14 +24,12 @@ $iorfileB = PerlACE::LocalFile ("$iorbaseB"); unlink $iorfileA; unlink $iorfileB; -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level"); -} -else { - $SV = new PerlACE::Process ("server", "-ORBdebuglevel $debug_level"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SV = new $class ("server", "-ORBDebuglevel $debug_level"); + $CL = new PerlACE::Process ("client", " -k file://$iorfile"); - + $server = $SV->Spawn (); if ($server != 0) { @@ -41,7 +39,7 @@ if ($server != 0) { if (PerlACE::waitforfile_timed ($iorfileA, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; + print STDERR "ERROR: cannot find file <$iorfileA>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; } @@ -53,7 +51,7 @@ if ($client != 0) { $status = 1; } -$server = $SV->WaitKill (10); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Bug_3154_Regression/README b/TAO/tests/Bug_3154_Regression/README new file mode 100644 index 00000000000..effb1a6fd58 --- /dev/null +++ b/TAO/tests/Bug_3154_Regression/README @@ -0,0 +1,21 @@ +This test uses newly implemented -Se feature of tao_idl. Using this feature +user can prohibit custom endings (e.g. -hs or -hc) for TAO specific include fils. + +__Regression Output__ + +[vzykov@glasgow tao566_regression]$ ./run_test.pl +ERROR: Custom endings are incorrectly applied. + + +__Successful Output__ + +[vzykov@glasgow tao563_regression]$ ./run_test.pl +processing test.idl +INFO: orbsvcs/FT_CORBA_ORBC.h +INFO: orbsvcs/CosNotification_stub.h +INFO: orbsvcs/PortableGroupC.h +INFO: test_stub.h +INFO: orbsvcs/FT_CORBA_ORBC.h +INFO: orbsvcs/CosNotification_skel.h +INFO: orbsvcs/PortableGroupS.h +INFO: Test passed! diff --git a/TAO/tests/Bug_3154_Regression/orbsvcs/CosNotification.idl b/TAO/tests/Bug_3154_Regression/orbsvcs/CosNotification.idl new file mode 100644 index 00000000000..7d051f9e877 --- /dev/null +++ b/TAO/tests/Bug_3154_Regression/orbsvcs/CosNotification.idl @@ -0,0 +1,392 @@ +// $Id$ + +/** + * @file CosNotification.idl + * + * @brief Define the CosNotification module + * + * CosNotification.idl,v 1.3 2002/07/01 14:13:59 parsons Exp + * + * @author Pradeep Gore <pradeep@cs.wustl.edu> + */ + +#ifndef _COS_NOTIFICATION_IDL_ +#define _COS_NOTIFICATION_IDL_ + +#pragma prefix "omg.org" + +/** + * @namespace CosNotification + * + * @brief Define basic data structures used by the Notification + * Service + */ +module CosNotification +{ + /// Dummy typedef for strings, if the intent was to support I18N + /// strings the spec should have used wstring + typedef string Istring; + + /// Properties are named using a string + typedef Istring PropertyName; + + /// Property values are stored using anys + typedef any PropertyValue; + + /** + * @struct Property + * + * @brief Define a name/value pair. + * + * Events are described using named/value sequences, this structure + * defines the name/value pair. + */ + struct Property { + /// The name + PropertyName name; + /// The value + PropertyValue value; + }; + + /// Define a sequence of properties. + typedef sequence<Property> PropertySeq; + + //@{ + /** + * @name Different kinds of property sequences + * + * @brief The following are all sequences of Property, but + * serve different purposes. + */ + /// Property sequence used for optional header fields + typedef PropertySeq OptionalHeaderFields; + + /// Property sequence used for the event body that can be used + /// in filtering + typedef PropertySeq FilterableEventBody; + + /// Specify quality of service properties + typedef PropertySeq QoSProperties; + + /// Specify administrative properties + typedef PropertySeq AdminProperties; + //@} + + /** + * @struct _EventType + * + * @brief Define event type names. + * + * Different vertical industries (domains) can define well-known + * events (event_types). This structure is used for that purpose + */ + struct _EventType { + /// The name of the vertical industry defining the event type. + string domain_name; + /// The type of event. + string type_name; + }; + /// A sequence of event types + typedef sequence<_EventType> EventTypeSeq; + + /** + * @struct PropertyRange + * + * @brief A structure to define property ranges. + * + */ + struct PropertyRange { + /// Lower end of the range + PropertyValue low_val; + /// High end of the range + PropertyValue high_val; + }; + + /** + * @struct NamedPropertyRange + * + * @brief A named property range + */ + struct NamedPropertyRange { + /// The name + PropertyName name; + /// The range + PropertyRange range; + }; + /// A sequence of named property ranges + typedef sequence<NamedPropertyRange> NamedPropertyRangeSeq; + + /** + * @enum QoSError_code + * + * @brief Describe QoS errors. + */ + enum QoSError_code { + /// The application has requested an unsupported QoS property + UNSUPPORTED_PROPERTY, + /// The application has requested a QoS property that, though + /// supported, cannot be set in the requested scope. + UNAVAILABLE_PROPERTY, + /// The application has requested a QoS property with an + /// unsupported value. + UNSUPPORTED_VALUE, + /// The application has requested a QoS property with a supported + /// value, but unavailable at the requeste scope. + UNAVAILABLE_VALUE, + /// The property name is unknown or not recognized. + BAD_PROPERTY, + /// The value type for the requested property is invalid + BAD_TYPE, + /// The value for the requested property is illegal + BAD_VALUE + }; + + /** + * @struct PropertyError + * + * @brief Describe the problems detected with an application + * requested QoS. + * + * If there are any problems with an application request for QoS the + * problems are raised using an exception that contains all the + * problems, and a description of the valid values (if they apply). + */ + struct PropertyError { + /// Property error description + QoSError_code code; + /// Property name with a problem + PropertyName name; + /// Valid range for that property in the Notification Service + /// implementation + PropertyRange available_range; + }; + /// List of property errors. + typedef sequence<PropertyError> PropertyErrorSeq; + + /** + * @exception UnsupportedQoS + * + * @brief Exception used to describe problems with one or more QoS + * requests + * + */ + exception UnsupportedQoS { + /// Complete description of the properties in error + PropertyErrorSeq qos_err; + }; + + /** + * @exception UnsupportedAdmin + * + * @brief Exception used to describe problems with one or more Admin + * properties + */ + exception UnsupportedAdmin { + /// The complete description of the invalid properties. + PropertyErrorSeq admin_err; + }; + + /** + * @struct FixedEventHeader + * + * @brief Define the 'fixed' part of the event header + */ + struct FixedEventHeader { + /// The event type + _EventType event_type; + /// A (possibly unique) name for the particular event + string event_name; + }; + + /** + * @struct EventHeader + * + * @brief Complete event header + */ + struct EventHeader { + /// The fixed part of the event header + FixedEventHeader fixed_header; + /// The optional part + OptionalHeaderFields variable_header; + }; + + /** + * @struct StructuredEvent + * + * @brief Define structured events + */ + struct StructuredEvent { + /// The header + EventHeader header; + /// The part of the body used for filtering + FilterableEventBody filterable_data; + /// The part of the body not used for filtering + any remainder_of_body; + }; + /// Sequence of events, for batch processing + typedef sequence<StructuredEvent> EventBatch; + + //@{ + /** + * @name Constants for QoS Properties + * + * The following constant declarations define the standard QoS + * property names and the associated values each property can take + * on. The name/value pairs for each standard property are grouped, + * beginning with a string constant defined for the property name, + * followed by the values the property can take on. + */ + + const string EventReliability = "EventReliability"; + const short BestEffort = 0; + const short Persistent = 1; + + /// Can take on the same values as EventReliability + const string ConnectionReliability = "ConnectionReliability"; + + const string Priority = "Priority"; + const short LowestPriority = -32767; + const short HighestPriority = 32767; + const short DefaultPriority = 0; + + /// StartTime takes a value of type TimeBase::UtcT. + const string StartTime = "StartTime"; + + /// StopTime takes a value of type TimeBase::UtcT. + const string StopTime = "StopTime"; + + /// Timeout takes on a value of type TimeBase::TimeT + const string Timeout = "Timeout"; + + const string OrderPolicy = "OrderPolicy"; + const short AnyOrder = 0; + const short FifoOrder = 1; + const short PriorityOrder = 2; + const short DeadlineOrder = 3; + + /// DiscardPolicy takes on the same values as OrderPolicy, plus + const string DiscardPolicy = "DiscardPolicy"; + const short LifoOrder = 4; + + /// MaximumBatchSize takes on a value of type long + const string MaximumBatchSize = "MaximumBatchSize"; + + /// PacingInterval takes on a value of type TimeBase::TimeT + const string PacingInterval = "PacingInterval"; + + /// StartTimeSupported takes on a boolean value + const string StartTimeSupported = "StartTimeSupported"; + + /// StopTimeSupported takes on a boolean value + const string StopTimeSupported = "StopTimeSupported"; + + /// MaxEventsPerConsumer takes on a value of type long + const string MaxEventsPerConsumer = "MaxEventsPerConsumer"; + + //@} + + /** + * @interface QoSAdmin + * + * @brief Interface used to control the QoS properties of an Event + * Service components (Channel, Proxy, etc.) + * + * QoS properties of a channel can be set at different levels, + * including the proxies, the ConsumerAdmin and the SupplierAdmin + * objects. Each one of those components offers this interface to + * allow control over the properties. + */ + interface QoSAdmin { + /// Get the current QoS properties + /** + * The operation returns the properties set: + * - At the level queried + * - Not set at the level queried but set at a higher-level + * - Not set at all but having a default value. + */ + QoSProperties get_qos(); + + /// Set the QoS properties + /** + * @param qos The requested QoS properties + * @throws UnsupportedQoS if the requested QoS cannot be + * implemented or is invalid. The exception contents describe + * the problem(s) in detail. + */ + void set_qos ( in QoSProperties qos) + raises ( UnsupportedQoS ); + + /// Validate a set of QoS properties + /** + * @param required_qos the list of properties requested by the + * application + * @param available_qos If the properties are supported this + * argument returns a list of any other properties that + * could also be set. + * @throws UnsupportedQoS if the requested QoS cannot be + * implemented or is invalid. The exception contents describe + * the problem(s) in detail. + */ + void validate_qos (in QoSProperties required_qos, + out NamedPropertyRangeSeq available_qos ) + raises ( UnsupportedQoS ); + }; + + //@{ + /** + * @name Constants for Admin Properties + * + * Admin properties are defined in similar manner as QoS + * properties. The only difference is that these properties are + * related to channel administration policies, as opposed message + * quality of service + */ + /// MaxQueueLength takes on a value of type long + const string MaxQueueLength = "MaxQueueLength"; + + /// MaxConsumers takes on a value of type long + const string MaxConsumers = "MaxConsumers"; + + /// MaxSuppliers takes on a value of type long + const string MaxSuppliers = "MaxSuppliers"; + + /// RejectNewEvents takes on a value of type Boolean + const string RejectNewEvents = "RejectNewEvents"; + //@} + + /** + * @interface AdminPropertiesAdmin + * + * @brief Define the interface to manipulate the Admin properties of + * a Notification Service components + * + * Several Notification Service components have Admin properties, + * including the Event Channel, its ConsumerAdmin and SupplierAdmin + * objects as well as the proxies. This interface is used to + * control the Admin properties of each one of those components. + */ + interface AdminPropertiesAdmin { + /// Get the Admin properties + /** + * The operation returns the properties set: + * - At the level queried + * - Not set at the level queried but set at a higher-level + * - Not set at all but having a default value. + */ + AdminProperties get_admin(); + + /// Set the Admin properities + /** + * @param admin The list of Admin properties requested + * @throws UnsupportedAdmin if the requested admin properties + * cannot be implemented or are invalid + */ + void set_admin (in AdminProperties admin) + raises ( UnsupportedAdmin); + }; + +}; + +#pragma prefix "" + +#endif /* _COS_NOTIFICATION_IDL_ */ diff --git a/TAO/tests/Bug_3154_Regression/run_test.pl b/TAO/tests/Bug_3154_Regression/run_test.pl new file mode 100755 index 00000000000..f9d5cc3747b --- /dev/null +++ b/TAO/tests/Bug_3154_Regression/run_test.pl @@ -0,0 +1,88 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +# The location of the tao_idl utility - depends on O/S +if ($^O eq "MSWin32") +{ + $tao_idl = "../../../bin/tao_idl"; +} +else +{ + $tao_idl = "../../../TAO/TAO_IDL/tao_idl"; +} + +# IDL file names +$idl_file = PerlACE::LocalFile ("test.idl"); + +# The IDL compiler +$TAO_IDL = new PerlACE::Process ("$tao_idl"); + +$TAO_IDL->Arguments ("-Se -hs _skel.h -hc _stub.h test.idl"); +$TAO_IDL->SpawnWaitKill (20); + +$found = 0; + +$stub_h = PerlACE::LocalFile("test_stub.h"); +open (STUB_HANDLE, "<$stub_h"); +while ($line = <STUB_HANDLE>) +{ + # Process the line. + chomp $line; + + if ($line =~ /^\#include \"orbsvcs\/FT_CORBA_ORBC\.h\"$/) { + print "INFO: orbsvcs/FT_CORBA_ORBC.h\n"; + $found++; + } + if ($line =~ /^\#include \"orbsvcs\/CosNotification_stub\.h\"$/) { + print "INFO: orbsvcs/CosNotification_stub.h\n"; + $found++; + } + if ($line =~ /\#include \"orbsvcs\/PortableGroupC\.h\"$/) { + print "INFO: orbsvcs/PortableGroupC.h\n"; + $found++; + } +} +close(STUB_HANDLE); + +$skel_h = PerlACE::LocalFile("test_skel.h"); +open (SKEL_HANDLE, "<$skel_h"); +while ($line = <SKEL_HANDLE>) +{ + # Process the line. + chomp $line; + + if ($line =~ /^\#include \"test_stub\.h\"$/) { + print "INFO: test_stub.h\n"; + $found++; + } + if ($line =~ /^\#include \"orbsvcs\/FT_CORBA_ORBS\.h\"$/) { + print "INFO: orbsvcs/FT_CORBA_ORBC.h\n"; + $found++; + } + if ($line =~ /^\#include \"orbsvcs\/CosNotification_skel\.h\"$/) { + print "INFO: orbsvcs/CosNotification_skel.h\n"; + $found++; + } + if ($line =~ /\#include \"orbsvcs\/PortableGroupS\.h\"$/) { + print "INFO: orbsvcs/PortableGroupS.h\n"; + $found++; + } +} +close(SKEL_HANDLE); + +unlink <*.cpp *.inl *.h>; + +if ($found == 7) { + print "INFO: Test passed!\n"; + exit 0; +} else { + print STDERR "ERROR: Custom endings are incorrectly applied.\n"; + exit 1; +} diff --git a/TAO/tests/Bug_3154_Regression/test.idl b/TAO/tests/Bug_3154_Regression/test.idl new file mode 100644 index 00000000000..e4ec773839e --- /dev/null +++ b/TAO/tests/Bug_3154_Regression/test.idl @@ -0,0 +1,318 @@ +// $Id$ + +// The next include is TAO specific. +#include "orbsvcs/FT_CORBA_ORB.idl" + +#include "orbsvcs/CosNotification.idl" +#include "orbsvcs/PortableGroup.idl" + +#pragma prefix "omg.org" + +/** +* This module describes interfaces and data types of the CORBA +* Fault Tolerance service. +*/ + +module FT +{ + /// Specification for the Common Types and Exceptions for + /// ReplicationManager + + /// Forward declarations + interface GenericFactory; + interface FaultNotifier; + + /// Useful typedefs. + typedef CORBA::RepositoryId _TypeId; + typedef Object ObjectGroup; + + typedef any Value; + + /** + * @struct Property + * + * @brief A property name and a value association. + */ + struct Property { + Value val; + }; + + /// Some mor euseful typedefs. + typedef sequence<Property> Properties; + typedef Properties Criteria; + + /** + * @struct FactoryInfo + * + * @brief <@todo> + * + */ + struct FactoryInfo { + GenericFactory the_factory; + Criteria the_criteria; + }; + + typedef sequence<FactoryInfo> FactoryInfos; + + typedef long ReplicationStyleValue; + const ReplicationStyleValue STATELESS = 0; + const ReplicationStyleValue COLD_PASSIVE = 1; + const ReplicationStyleValue WARM_PASSIVE = 2; + const ReplicationStyleValue ACTIVE = 3; + const ReplicationStyleValue ACTIVE_WITH_VOTING = 4; + typedef long MembershipStyleValue; + const MembershipStyleValue MEMB_APP_CTRL = 0; + const MembershipStyleValue MEMB_INF_CTRL = 1; + typedef long ConsistencyStyleValue; + const ConsistencyStyleValue CONS_APP_CTRL = 0; + const ConsistencyStyleValue CONS_INF_CTRL = 1; + typedef long FaultMonitoringStyleValue; + const FaultMonitoringStyleValue PULL = 0; + const FaultMonitoringStyleValue PUSH = 1; + const FaultMonitoringStyleValue NOT_MONITORED = 2; + typedef long FaultMonitoringGranularityValue; + const FaultMonitoringGranularityValue MEMB = 0; + const FaultMonitoringGranularityValue LOC = 1; + const FaultMonitoringGranularityValue LOC_AND_TYPE = 2; + typedef FactoryInfos FactoriesValue; + typedef unsigned short InitialNumberReplicasValue; + typedef unsigned short MinimumNumberReplicasValue; + + typedef TimeBase::TimeT CheckpointIntervalValue; + exception InterfaceNotFound {}; + exception ObjectGroupNotFound {}; + exception MemberNotFound {}; + exception MemberAlreadyPresent {}; + exception BadReplicationStyle {}; + exception ObjectNotCreated {}; + exception ObjectNotAdded {}; + exception PrimaryNotSet {}; + exception UnsupportedProperty { + Value val; + }; + + exception InvalidProperty { + Value val; }; + + exception NoFactory { + _TypeId type_id; }; + + exception InvalidCriteria { + Criteria invalid_criteria; }; + + exception CannotMeetCriteria { + Criteria unmet_criteria; }; + + // Specification of PropertyManager Interface + // which ReplicationManager Inherits + + interface PropertyManager { + + void set_default_properties(in Properties props) + raises (InvalidProperty, UnsupportedProperty); + Properties get_default_properties(); + + void remove_default_properties(in Properties props) + raises (InvalidProperty, UnsupportedProperty); + + void set_type_properties(in _TypeId type_id, + in Properties overrides) + raises (InvalidProperty, UnsupportedProperty); + + Properties get_type_properties(in _TypeId type_id); + + void remove_type_properties(in _TypeId type_id, + in Properties props) + raises (InvalidProperty, UnsupportedProperty); + + void set_properties_dynamically(in ObjectGroup object_group, + in Properties overrides) + raises(ObjectGroupNotFound, InvalidProperty, UnsupportedProperty); + + Properties get_properties(in ObjectGroup object_group) + raises(ObjectGroupNotFound); }; + + // Specification of ObjectGroupManager Interface + // which ReplicationManager Inherits + /** + * This interface provides operations that allow an application to add, remove + * and locate members of an object group and to obtain the current reference and + * identifier for an object group. + * + */ + + interface ObjectGroupManager { + /** + * This operation allows the application to exercise explicit control over the + * creation of a member of an object group, and to determine where the member + * is created. + * + * @param object_group Reference for the object group to which the member is + * to be added. + * @param the_location The physical location. + * @param type_id The repository identifier for the type of the object. + * @param the_criteria Parameters to be passed to the factory, which the factory + * evaluates before creating the object. + * + * @return The object group reference of the object group with the member added. + */ + ObjectGroup create_member(in ObjectGroup object_group, + in _TypeId type_id, + in Criteria the_criteria) + raises(ObjectGroupNotFound, + MemberAlreadyPresent, + NoFactory, + ObjectNotCreated, + InvalidCriteria, + CannotMeetCriteria); + + /** + * This operation allows an application to add an existing object to an object + * group at a particular location. + * + * @param object_group Reference for the object group to which the existing object + * is to be added. + * @param the_location The physical location of the object to be added. + * @param member The reference of the object to be added. + * + * @return The object group reference of the object group with the object added. + */ + ObjectGroup add_member(in ObjectGroup object_group, + in Object member) + raises(ObjectGroupNotFound, + MemberAlreadyPresent, + ObjectNotAdded); + + /** + * This operation allows an application to remove a member from an object + * group at a particular location. + * + * @param object_group Reference for the object group to which the member + * is to be removed. + * @param the_location The physical location of the member to be removed. + * + * @return The object group reference of the member removed. + */ + ObjectGroup remove_member(in ObjectGroup object_group) + raises(ObjectGroupNotFound, + MemberNotFound); + + /** + * This operation allows the application to select the member of the object group + * that is to be the primary. + * + * @param object_group Reference for the object group whose primary is to be + * determined. + * @param the_location The physical location of the member that is to become + * the primary. + * + * @return The object group reference with the primary member at the given + * location. + */ + ObjectGroup set_primary_member(in ObjectGroup object_group) + raises(ObjectGroupNotFound, + MemberNotFound, + PrimaryNotSet, + BadReplicationStyle); + + ObjectGroupId get_object_group_id(in ObjectGroup object_group) + raises(ObjectGroupNotFound); + + ObjectGroup get_object_group_ref(in ObjectGroup object_group) + raises(ObjectGroupNotFound); + + Object get_member_ref(in ObjectGroup object_group) + raises(ObjectGroupNotFound, MemberNotFound); }; + + + // Specification of GenericFactory Interface + // which ReplicationManager Inherits and Application Objects Implement + /** + * This interface allows the creation/deletion of replicated objects (object groups), + * replicas (members of object groups), and unreplicated objects. + */ + interface GenericFactory { + typedef any FactoryCreationId; + + /** + * This operation creates an object or an object group, using the type_id + * parameter to determine which type of object to create and the_criteria + * parameter to determine restrictions on how and where to create the object. + * + * @param type_id The repository identifier of the object to be created by + * the factory. + * + * @param the_criteria Information passed to the factory, which the factory + * evaluates before creating the object. Examples of criteria are initialization + * values, constraints on the object, preferred location of the object, fault + * tolerance properties for an object group, etc. + * + * @param factory_creation_id An identifier that allows the factory to delete + * the object subsequently. + * + * @return The reference to the object created by the GenericFactory. When the + * GenericFactory interface is implemented by the application’s local factory + * object, the create_object() operation returns an object reference as a result. + * When the GenericFactory interface is inherited by the Replication Manager, the + * create_object() operation returns an object group reference as a result. + * + * @exception NoFactory Raised if the factory cannot create an individual object + * of the type_id at the location. + * @exception ObjectNotCreated Raised if the factory cannot create the object. + * @exception InvalidCriteria Raised if the factory does not understand the criteria. + * @exception InvalidProperty Raised if a property passed in as criteria is invalid. + * @exception CannotMeetCriteria Raised if the factory understands the criteria but + * cannot satisfy it. + */ + Object create_object(in _TypeId type_id, + in Criteria the_criteria, + out FactoryCreationId factory_creation_id) + raises (NoFactory, + ObjectNotCreated, + InvalidCriteria, + InvalidProperty, + CannotMeetCriteria); }; + + // Specification of ReplicationManager Interface + interface ReplicationManager : PropertyManager, + ObjectGroupManager, + GenericFactory { + void register_fault_notifier(in FaultNotifier fault_notifier); + FaultNotifier get_fault_notifier() + raises (InterfaceNotFound); }; + + // Specification of FaultNotifier Interface + interface FaultNotifier { + typedef unsigned long long ConsumerId; + + void push_structured_fault( + in CosNotification::StructuredEvent event); + + void push_sequence_fault( + in CosNotification::EventBatch events); + + }; + + // Specifications for Logging and Recovery + typedef sequence<octet> State; + + exception NoStateAvailable {}; + exception InvalidState {}; + + exception NoUpdateAvailable {}; + exception InvalidUpdate {}; + + // Specification of Checkpointable Interface + // which Updateable and Application Objects Inherit + interface Checkpointable { State get_state() + raises(NoStateAvailable); + void set_state(in State s) raises(InvalidState); }; + + // Specification of Updateable Interface + // which Application Objects Inherit + interface Updateable : Checkpointable { State get_update() + raises(NoUpdateAvailable); + void set_update(in State s) raises(InvalidUpdate); + }; + +}; diff --git a/TAO/tests/Bug_3163_Regression/Bug_3163_Regression.mpc b/TAO/tests/Bug_3163_Regression/Bug_3163_Regression.mpc new file mode 100644 index 00000000000..6b3e52a0182 --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/Bug_3163_Regression.mpc @@ -0,0 +1,36 @@ +// -*- MPC -*- +// $Id$ + +project(*idl): taoidldefaults { + idlflags += -Sp + IDL_Files { + test.idl + } + custom_only = 1 +} + +project(*Server): taoserver { + after += *idl + Source_Files { + server.cpp + } + Source_Files { + testC.cpp + testS.cpp + } + IDL_Files { + } +} + +project(*Client): taoclient { + after += *idl + Source_Files { + client.cpp + } + Source_Files { + testC.cpp + } + IDL_Files { + } +} + diff --git a/TAO/tests/Bug_3163_Regression/client.cpp b/TAO/tests/Bug_3163_Regression/client.cpp new file mode 100644 index 00000000000..e3824d770cc --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/client.cpp @@ -0,0 +1,80 @@ +// $Id$ + +#include "testC.h" +#include "ace/Get_Opt.h" + +ACE_RCSID(Hello, client, "$Id$") + +const char *ior = "file://test.ior"; +int message_size = 0; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:v:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + case 'v' : + message_size = ACE_OS::atoi (get_opts.opt_arg ()); + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var tmp = orb->string_to_object(ior); + + ctest_var hello = ctest::_narrow(tmp.in ()); + + if (CORBA::is_nil (hello.in ())) + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Test::Hello reference <%s>\n", + ior), + 1); + } + + ctest::UCSeq_var data; + + hello->ctestfn(message_size, data.out ()); + + ACE_DEBUG ((LM_DEBUG, "Received %d bytes\n", data->length())); + + hello->shutdown (); + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} + + diff --git a/TAO/tests/Bug_3163_Regression/run_test.pl b/TAO/tests/Bug_3163_Regression/run_test.pl new file mode 100755 index 00000000000..4c2190b83e7 --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/run_test.pl @@ -0,0 +1,68 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $target = PerlACE::TestTarget::create_target ($PerlACE::TestConfig); + +$iorbase = "server.ior"; +$iorfile = $target->LocalFile ("$iorbase"); +$target->DeleteFile($iorfile); + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level -o $iorbase -ORBStdProfileComponents 0 -ORBSvcConf server.conf"); +} +else { + $SV = $target->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $iorfile -ORBStdProfileComponents 0 -ORBSvcConf server.conf"); +} +$CL = $target->CreateProcess ("client", "-v 131401 -k file://$iorfile"); + +$server = $SV->Spawn (); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + exit 1; +} + +if ($target->WaitForFileTimed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (10); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +$target->GetStderrLog(); + +#unlink $iorfile; +$target->DeleteFile($iorfile); + +exit $status; diff --git a/TAO/tests/Bug_3163_Regression/server.conf b/TAO/tests/Bug_3163_Regression/server.conf new file mode 100644 index 00000000000..14378c72309 --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/server.conf @@ -0,0 +1,3 @@ +static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock thread -ORBAllowReactivationOfSystemids 0" +static Resource_Factory "-ORBConnectionCacheMax 10 -ORBNativeWcharCodeSet 0x00010109 -ORBFlushingStrategy blocking" +static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive -ORBConnectStrategy blocked -ORBConnectionHandlerCleanup 1" diff --git a/TAO/tests/Bug_3163_Regression/server.cpp b/TAO/tests/Bug_3163_Regression/server.cpp new file mode 100644 index 00000000000..e7df2954cd5 --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/server.cpp @@ -0,0 +1,131 @@ +// $Id$ + +#include "tao/corba.h" +#include "tao/PortableServer/PortableServer.h" +#include "testS.h" +#include "ace/Get_Opt.h" +#include "ace/OS_NS_stdio.h" + +const char *ior_output_file = "test.ior"; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "o:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +class ctest_impl : public virtual POA_ctest +{ +public: + /// Constructor + ctest_impl (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb)) {} + + CORBA::Long ctestfn(CORBA::Long size, ctest::UCSeq_out data) + { + data = new ctest::UCSeq; + + data->length(size); + + for (CORBA::ULong i = 0; i < data->length(); ++i) + { + data[i] = (rand() % 26) + 'A'; + } + + return 0; + } + void shutdown (void) + { + this->orb_->shutdown (0); + } + +private: + /// Use an ORB reference to convert strings to objects and shutdown + /// the application. + CORBA::ORB_var orb_; +}; + +int main(int argc, char * argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Panic: nil RootPOA\n"), + 1); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); + + if (parse_args (argc, argv) != 0) + return 1; + + ctest_impl *hello_impl = 0; + ACE_NEW_RETURN (hello_impl, + ctest_impl (orb.in ()), + 1); + PortableServer::ServantBase_var owner_transfer(hello_impl); + + PortableServer::ObjectId_var id = + root_poa->activate_object (hello_impl); + + CORBA::Object_var object = root_poa->id_to_reference (id.in ()); + + ctest_var hello = ctest::_narrow (object.in ()); + + CORBA::String_var ior = orb->object_to_string (hello.in ()); + + // Output the IOR to the <ior_output_file> + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s\n", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + + poa_manager->activate (); + + orb->run(); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); + + root_poa->destroy (1, 1); + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} + diff --git a/TAO/tests/Bug_3163_Regression/test.idl b/TAO/tests/Bug_3163_Regression/test.idl new file mode 100644 index 00000000000..61fad5e0cce --- /dev/null +++ b/TAO/tests/Bug_3163_Regression/test.idl @@ -0,0 +1,12 @@ +// +// $Id$ +// +#include "tao/CharSeq.pidl" + +interface ctest { + typedef CORBA::CharSeq UCSeq; + + long ctestfn(in long size, out UCSeq data); + + oneway void shutdown (); +}; diff --git a/TAO/tests/Bug_3171_Regression/Bug_3171_Regression.mpc b/TAO/tests/Bug_3171_Regression/Bug_3171_Regression.mpc new file mode 100644 index 00000000000..ae45ad8aea9 --- /dev/null +++ b/TAO/tests/Bug_3171_Regression/Bug_3171_Regression.mpc @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project(*Server): taoserver, valuetype, messaging, utils, threads { + Source_Files { + server.cpp + } +} + diff --git a/TAO/tests/Bug_3171_Regression/run_test.pl b/TAO/tests/Bug_3171_Regression/run_test.pl new file mode 100755 index 00000000000..c781dd24db4 --- /dev/null +++ b/TAO/tests/Bug_3171_Regression/run_test.pl @@ -0,0 +1,27 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("server"); +} +else { + $SV = new PerlACE::Process ("server"); +} +$server = $SV->SpawnWaitKill (60); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + exit 1; +} + +exit $status; diff --git a/TAO/tests/Bug_3171_Regression/server.cpp b/TAO/tests/Bug_3171_Regression/server.cpp new file mode 100644 index 00000000000..a7b3bb224c6 --- /dev/null +++ b/TAO/tests/Bug_3171_Regression/server.cpp @@ -0,0 +1,217 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "tao/corba.h" +#include "tao/Utils/ORB_Manager.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/Messaging/Messaging.h" +#include "tao/ORBInitializer_Registry.h" +#include "tao/PI/PI.h" + +int g_nthreads = 1; +bool g_setTimeout = true; +bool g_registerORBinitializer = true; +bool g_initInMain = false; +int g_argc; +char ** g_argv; + +int initORB(int threadID); + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "min:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'm': + g_initInMain = true; + break; + + case 'i': + g_registerORBinitializer = false; + break; + + case 'n': + g_nthreads = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-m (Initialize an ORB from the main thread first) " + "-i (Do not register ORB initializer) " + "-n <numberOfThreads>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +class Worker : public ACE_Task_Base +{ +public: + Worker (); + + virtual int svc (void); + +private: +}; + +class MyORBinitializer + : public PortableInterceptor::ORBInitializer +{ +public: + MyORBinitializer( ACE_CString orbID ) + : orbID_( orbID ) {}; + + virtual + void + pre_init( PortableInterceptor::ORBInitInfo_ptr ) + { + ACE_DEBUG ((LM_DEBUG, + "MyORBinitializer::pre_init() called for ORB \"%s\"\n", + orbID_.c_str())); + }; + + virtual + void + post_init( PortableInterceptor::ORBInitInfo_ptr ) + { + ACE_DEBUG ((LM_DEBUG, + "MyORBinitializer::post_init() called for ORB \"%s\"\n", + orbID_.c_str())); + }; + + private: + ACE_CString orbID_; +}; + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + g_argc = argc; + g_argv = argv; + + try + { + if (parse_args (argc, argv) != 0) + return 1; + + if ( g_initInMain ) + { + initORB(0); + } +// Run in both main and background thread +// else + { + Worker worker; + if (worker.activate (THR_NEW_LWP | THR_JOINABLE, + g_nthreads) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot activate ORB thread(s)\n"), + 1); + + worker.thr_mgr ()->wait (); + + } + ACE_DEBUG ((LM_DEBUG, "Event loop finished\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} + +// **************************************************************** + +Worker::Worker () +{ +} + +int +Worker::svc (void) +{ + static int threadID = 0; + + initORB(++threadID); + + return 0; +} + +int +initORB(int threadID) +{ + try + { + char ORBid[10]; + ACE_OS::sprintf (ORBid, "ORB_%d", threadID); + + ACE_DEBUG ((LM_DEBUG, "Initializing ORB \"%s\"\n", ORBid)); + + if ( g_registerORBinitializer ) + { + ACE_DEBUG ((LM_DEBUG, "Creating ORB initializer\n")); + PortableInterceptor::ORBInitializer_var rCOI( + new MyORBinitializer( ORBid ) ); + PortableInterceptor::register_orb_initializer( rCOI.in() ); + } + + ACE_DEBUG ((LM_DEBUG, "Creating TAO_ORB_Manager\n")); + TAO_ORB_Manager* pORBmgr = new TAO_ORB_Manager; + + if ( -1 == pORBmgr->init( g_argc, g_argv, ORBid ) ) + { + ACE_DEBUG ((LM_DEBUG, "Failed to initialize ORB \"%s\"\n", ORBid)); + throw CORBA::INTERNAL(); + } + + ACE_DEBUG ((LM_DEBUG, "ORB \"%s\" initialized\n", ORBid)); + + if ( g_setTimeout ) + { + ACE_DEBUG ((LM_DEBUG, + "Setting connection timeout policy for ORB \"%s\"\n", + ORBid)); + + CORBA::PolicyList policyList; + + CORBA::ORB_var orb = pORBmgr->orb(); + + TimeBase::TimeT connectionTimeout = 100*10000; + CORBA::Any any; + any <<= connectionTimeout; + + CORBA::ULong l( policyList.length() ); + policyList.length( l+1 ); + + policyList[l] = orb->create_policy( + TAO::CONNECTION_TIMEOUT_POLICY_TYPE, + any ); + + ACE_DEBUG ((LM_DEBUG, "Connection timeout policy set for ORB \"%s\"\n", + ORBid)); + } + + pORBmgr->fini(); + + delete pORBmgr; + } + catch (const CORBA::Exception& ex) + { + ACE_ERROR ((LM_ERROR, "Caught exception: %s\n", ex._info().c_str())); + return 1; + } + + return 0; +} + diff --git a/TAO/tests/CSD_Collocation/CSD_Collocation.mpc b/TAO/tests/CSD_Collocation/CSD_Collocation.mpc new file mode 100644 index 00000000000..ac31348ee28 --- /dev/null +++ b/TAO/tests/CSD_Collocation/CSD_Collocation.mpc @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : taoserver, taoidldefaults, strategies, csd_threadpool, avoids_corba_e_micro, avoids_corba_e_compact, avoids_minimum_corba { + + idlflags += -Gd -St -Sa + exename = Collocation +} diff --git a/TAO/tests/CSD_Collocation/Collocation.cpp b/TAO/tests/CSD_Collocation/Collocation.cpp new file mode 100644 index 00000000000..b5fdfbef9c3 --- /dev/null +++ b/TAO/tests/CSD_Collocation/Collocation.cpp @@ -0,0 +1,44 @@ +// $Id$ + +#include "Collocation_Tester.h" +#include "tao/Strategies/advanced_resource.h" +#include "tao/CSD_Framework/CSD_ORBInitializer.h" +#include "tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.h" +#include "tao/CSD_ThreadPool/CSD_ThreadPool.h" +#include "ace/Thread_Manager.h" + +ACE_RCSID(Collocation, main, "$Id$") + +int main (int argc, char *argv[]) +{ + try + { + Collocation_Test coll_test; + + int orig_argc = argc; + char **orig_argv = new char*[argc]; + for (int i = 0; i < argc; ++i) + { + orig_argv[i] = argv[i]; + } + + coll_test.init (argc, argv); + coll_test.run (); + coll_test.shutdown (); + + //reinitialize ORB to reproduce the problem + coll_test.init (orig_argc, orig_argv); + coll_test.run (); + coll_test.shutdown (); + + delete[] orig_argv; + //this will leak if we get an exception, but it's just a small test case + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Uncaught exception: "); + } + + ACE_Thread_Manager::instance()->wait(); + return 0; +} diff --git a/TAO/tests/CSD_Collocation/Collocation_Tester.cpp b/TAO/tests/CSD_Collocation/Collocation_Tester.cpp new file mode 100644 index 00000000000..82547e04551 --- /dev/null +++ b/TAO/tests/CSD_Collocation/Collocation_Tester.cpp @@ -0,0 +1,146 @@ +// $Id$ + +//============================================================================ +// +// =FILENAME +// Collocation_Test.h +// +// =DESCRIPTION +// Server class to perform testing of TAO's collocation mechanism. +// +// =AUTHOR +// Nanbor Wang +// +//============================================================================= + +#include "Collocation_Tester.h" + +Collocation_Test::Collocation_Test (void) +{ + // no-op. +} + +void +Collocation_Test::shutdown (void) +{ + this->root_poa_->destroy (1, 1); + this->orb_->destroy (); +} + +int +Collocation_Test::init (int argc, char *argv[]) +{ + // Initialize the ORB. + this->orb_ = CORBA::ORB_init (argc, argv, 0); + + int result = this->parse_args (argc, argv); + if (result != 0) + return result; + + // Get an Object reference to RootPOA. + CORBA::Object_var obj = + this->orb_->resolve_initial_references ("RootPOA"); + + // Narrow the Object reference to a POA reference + this->root_poa_ = + PortableServer::POA::_narrow (obj.in ()); + + // Get the POAManager of RootPOA + this->poa_manager_ = + this->root_poa_->the_POAManager (); + + // Create our own child POA + // Empty sequence means all default policies + int nPolicies = 0; + CORBA::PolicyList policies; + + policies.length(1); + policies[nPolicies++] = + this->root_poa_->create_implicit_activation_policy(PortableServer::IMPLICIT_ACTIVATION); + + obj = this->root_poa_->create_POA("child", this->poa_manager_.in(), policies); + PortableServer::POA_var childPOA = PortableServer::POA::_narrow (obj.in ()); + + // Destroy the Policy objects (before we may exit as a result of failures) + for (CORBA::ULong i = 0; i < policies.length(); ++i) + { + policies[i]->destroy(); + } + + // Activate the diamond servant and its base classes under childPOA. + PortableServer::ObjectId_var id = + childPOA->activate_object (&this->top_servant_); + +// // We only care about the most derived class here. +// this->diamond_obj_ = this->diamond_servant_._this (); + + id = + childPOA->activate_object (&this->diamond_servant_); + + // We only care about the most derived class here. + this->diamond_obj_ = childPOA->id_to_reference (id.in ()); + + id = + childPOA->activate_object (&this->left_servant_); + + id = + childPOA->activate_object (&this->right_servant_); + + + CORBA::String_var str = + this->orb_->object_to_string (this->diamond_obj_.in ()); + + ACE_DEBUG ((LM_DEBUG, "Diamond Servant activated:\n %s\n", + str.in())); + + return 0; + + +} + +int +Collocation_Test::parse_args (int /*argc*/, + char *[] /*argv*/) +{ + return 0; +} + +int +Collocation_Test::test_narrow (void) +{ + Diamond::Top_var top = + Diamond::Top::_narrow (this->diamond_obj_.in ()); + + Diamond::Left_var left = + Diamond::Left::_narrow (this->diamond_obj_.in ()); + + Diamond::Right_var right = + Diamond::Right::_narrow (this->diamond_obj_.in ()); + + Diamond::Buttom_var buttom = + Diamond::Buttom::_narrow (this->diamond_obj_.in ()); + + CORBA::String_var str = top->shape (); + ACE_DEBUG ((LM_DEBUG, "Calling top->shape: %s\n", str.in ())); + + str = left->shape (); + ACE_DEBUG ((LM_DEBUG, "Calling left->shape: %s\n", str.in ())); + + str = right->shape (); + ACE_DEBUG ((LM_DEBUG, "Calling right->shape: %s\n", str.in ())); + + str = buttom->shape (); + ACE_DEBUG ((LM_DEBUG, "Calling buttom->shape: %s\n", str.in ())); + + return 0; +} + +int +Collocation_Test::run (void) +{ + this->poa_manager_->activate (); + + this->test_narrow (); + + return 0; +} diff --git a/TAO/tests/CSD_Collocation/Collocation_Tester.h b/TAO/tests/CSD_Collocation/Collocation_Tester.h new file mode 100644 index 00000000000..9e04f7c6a74 --- /dev/null +++ b/TAO/tests/CSD_Collocation/Collocation_Tester.h @@ -0,0 +1,64 @@ +// $Id$ + +//============================================================================ +// +// = FILENAME +// Collocation_Test.h +// +// = DESCRIPTION +// Server class to perform testing of TAO's collocation mechanism. +// +// = AUTHOR +// Nanbor Wang +// +//============================================================================= + +#if !defined (TAO_COLLOCATION_TEST_H) +#define TAO_COLLOCATION_TEST_H + +#include "Diamond_i.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + + +class Collocation_Test +{ +public: + Collocation_Test (void); + + void shutdown (void); + + int init (int argc, char *argv[]); + // Initializing the Collocation_Test object. + + int parse_args (int argc, char *argv[]); + // Parse the test specific arguments. + + int test_narrow (void); + // This test narrow an object reference to its base class and see + // if it works correctly. + + int run (void); + // Run the test. + +private: + CORBA::ORB_var orb_; + + PortableServer::POA_var root_poa_; + + PortableServer::POAManager_var poa_manager_; + + CORBA::Object_var diamond_obj_; + // Our basic test object. + + Top_i top_servant_; + Left_i left_servant_; + Right_i right_servant_; + Buttom_i diamond_servant_; + // A collection of servant for basic narrowing test. +}; + +#endif /* TAO_COLLOCATION_TEST_H */ diff --git a/TAO/tests/CSD_Collocation/Diamond.idl b/TAO/tests/CSD_Collocation/Diamond.idl new file mode 100644 index 00000000000..0e60b25c52c --- /dev/null +++ b/TAO/tests/CSD_Collocation/Diamond.idl @@ -0,0 +1,24 @@ +// $Id$ + +module Diamond +{ + interface Top + { + string shape (); + }; + + interface Left : Top + { + string color (); + }; + + interface Right : Top + { + long width (); + }; + + interface Buttom : Left, Right + { + string name (); + }; +}; diff --git a/TAO/tests/CSD_Collocation/Diamond_i.cpp b/TAO/tests/CSD_Collocation/Diamond_i.cpp new file mode 100644 index 00000000000..8db13a90689 --- /dev/null +++ b/TAO/tests/CSD_Collocation/Diamond_i.cpp @@ -0,0 +1,105 @@ +// $Id$ + +#include "Diamond_i.h" + +Top_i::Top_i () +{ + // no-op. +} + +Top_i::~Top_i () +{ + // No-op. +} + +char * +Top_i::shape (void) +{ + return CORBA::string_dup ("a point."); +} + +Left_i::Left_i () +{ + // No-op. +} + +Left_i::~Left_i () +{ + // No-op. +} + +char * +Left_i::shape (void) +{ + return CORBA::string_dup ("the left line"); +} + +char * +Left_i::color (void) +{ + return CORBA::string_dup ("black"); +} + +Right_i::Right_i () +{ + // no-op. +} + +Right_i::~Right_i () +{ + // no-op. +} + +char * +Right_i::shape (void) +{ + return CORBA::string_dup ("the right line"); +} + +char * +Right_i::color (void) +{ + return CORBA::string_dup ("red"); + // +} + +CORBA::Long +Right_i::width (void) +{ + return 0; +} + +Buttom_i::Buttom_i () +{ + // no-op. +} + +Buttom_i::~Buttom_i () +{ + // no-op. +} + +char * +Buttom_i::shape (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) In servant\n")); + return CORBA::string_dup ("a diamond"); +} + +char * +Buttom_i::color (void) +{ + return CORBA::string_dup ("translucent"); +} + +CORBA::Long +Buttom_i::width (void) +{ + return 100; +} + +char * +Buttom_i::name (void) +{ + return CORBA::string_dup ("Jubilee"); +} diff --git a/TAO/tests/CSD_Collocation/Diamond_i.h b/TAO/tests/CSD_Collocation/Diamond_i.h new file mode 100644 index 00000000000..f8b04710830 --- /dev/null +++ b/TAO/tests/CSD_Collocation/Diamond_i.h @@ -0,0 +1,75 @@ +// $Id$ + +#if !defined (TAO_DIAMOND_I_H) +#define TAO_DIAMOND_I_H + +#include "DiamondS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +class Top_i : public POA_Diamond::Top +{ +public: + Top_i (void); + ~Top_i (void); + // Ctor and dtor. + + virtual char * shape (void); + // Return the shape of this object (interface.) +}; + +class Left_i : public POA_Diamond::Left +{ +public: + Left_i (void); + ~Left_i (void); + // Ctor, dtor. + + virtual char * shape (void); + // Return the shape of this object (interface.) + + virtual char * color (void); + // Return the color of this object (interface.) +}; + +class Right_i : public POA_Diamond::Right +{ +public: + Right_i (void); + ~Right_i (void); + // Ctor, dtor. + + virtual char * shape (void); + // Return the shape of this object (interface.) + + virtual char * color (void); + // Return the color of this object (interface.) + + virtual CORBA::Long width (void); + // Return the width of the stuff. +}; + +class Buttom_i : public POA_Diamond::Buttom +{ +public: + Buttom_i (void); + ~Buttom_i (void); + // Ctor, dtor. + + virtual char * shape (void); + // Return the shape of this object (interface.) + + virtual char * color (void); + // Return the color of this object (interface.) + + virtual CORBA::Long width (void); + // Return the width of the stuff. + + virtual char * name (void); + // Return the name of the object. +}; + +#endif /* TAO_DIAMOND_I_H */ diff --git a/TAO/tests/CSD_Collocation/README b/TAO/tests/CSD_Collocation/README new file mode 100644 index 00000000000..cd5de64caca --- /dev/null +++ b/TAO/tests/CSD_Collocation/README @@ -0,0 +1,6 @@ +This is the Collocation test adapted to use CSD, specifically CSD's thread-pool +(TP) stragegy. Collocation.cpp has been modified to shut down and restart the +CORBA objects (POAs, ORBs) since that is the use case that shows this +particular bug. Collocation_Tester.cpp has been modified to use a child POA, +which will use CSD TP when svc.conf.csd is used as the configuration file. + diff --git a/TAO/tests/CSD_Collocation/run_test.pl b/TAO/tests/CSD_Collocation/run_test.pl new file mode 100755 index 00000000000..eaa9da78531 --- /dev/null +++ b/TAO/tests/CSD_Collocation/run_test.pl @@ -0,0 +1,30 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +PerlACE::add_lib_path('.'); + +$status = 0; + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("Collocation", "-ORBSvcConf svc.conf.csd"); +} +else { + $SV = new PerlACE::Process ("Collocation", "-ORBSvcConf svc.conf.csd"); +} + + +$server = $SV->SpawnWaitKill (60); + +if ($server != 0) { + print STDERR "ERROR: Collocation returned $server \n"; + $status = 1; +} + +exit $status; diff --git a/TAO/tests/CSD_Collocation/svc.conf b/TAO/tests/CSD_Collocation/svc.conf new file mode 100644 index 00000000000..285b1297bd4 --- /dev/null +++ b/TAO/tests/CSD_Collocation/svc.conf @@ -0,0 +1,14 @@ +# $Id$ +# +# Please see $TAO_ROOT/docs/Options.html for details on these options. +# + +# This is a single threaded "server." +static Advanced_Resource_Factory "-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null" + +# Make sure we use RW client handler so if something goes wrong, the program will bloc, +# i.e., won't work. +static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler RW" + +# Not absolutely necessary for this test, but we add it for fun. +static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock null" diff --git a/TAO/tests/CSD_Collocation/svc.conf.csd b/TAO/tests/CSD_Collocation/svc.conf.csd new file mode 100644 index 00000000000..496c14b0103 --- /dev/null +++ b/TAO/tests/CSD_Collocation/svc.conf.csd @@ -0,0 +1,16 @@ +# $Id$ +# +# Please see $TAO_ROOT/docs/Options.html for details on these options. +# + +# This is a single threaded "server." +static Advanced_Resource_Factory "-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null" + +# Make sure we use RW client handler so if something goes wrong, the program will bloc, +# i.e., won't work. +static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler RW" + +# Not absolutely necessary for this test, but we add it for fun. +static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock null" + +static TAO_CSD_TP_Strategy_Factory "-CSDtp child:2:OFF" diff --git a/TAO/tests/CSD_Collocation/svc.conf.xml b/TAO/tests/CSD_Collocation/svc.conf.xml new file mode 100644 index 00000000000..36246c69725 --- /dev/null +++ b/TAO/tests/CSD_Collocation/svc.conf.xml @@ -0,0 +1,15 @@ +<?xml version='1.0'?> +<!-- Converted from ./tests/Collocation/svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- $Id$ --> + <!-- --> + <!-- Please see $TAO_ROOT/docs/Options.html for details on these options. --> + <!-- --> + <!-- This is a single threaded "server." --> + <static id="Advanced_Resource_Factory" params="-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null"/> + <!-- Make sure we use RW client handler so if something goes wrong, the program will bloc, --> + <!-- i.e., won't work. --> + <static id="Client_Strategy_Factory" params="-ORBProfileLock null -ORBClientConnectionHandler RW"/> + <!-- Not absolutely necessary for this test, but we add it for fun. --> + <static id="Server_Strategy_Factory" params="-ORBConcurrency reactive -ORBPOALock null"/> +</ACE_Svc_Conf> diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h index f3bc9706e2c..50aa093f9a6 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h @@ -24,7 +24,7 @@ class CSD_TP_Test_Export AppShutdown private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; LockType lock_; diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h index 272b1829c89..895aeaa52cb 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h @@ -25,7 +25,7 @@ class ClientEngine; typedef TAO_Intrusive_Ref_Count_Handle<ClientEngine> ClientEngine_Handle; -class CSD_TP_Test_Export ClientEngine : public TAO_Intrusive_Ref_Count_Base<ACE_SYNCH_MUTEX> +class CSD_TP_Test_Export ClientEngine : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { public: diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h index cc3de7ec8a2..006035f2347 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h @@ -37,7 +37,7 @@ class CSD_TP_Test_Export ClientTask : public ACE_Task_Base private: - typedef ACE_SYNCH_MUTEX LockType; + typedef TAO_SYNCH_MUTEX LockType; typedef ACE_Guard<LockType> GuardType; typedef ACE_Vector<ClientEngine_Handle> EngineVector; diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl b/TAO/tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl index e9289a8d63c..908cfa341f9 100755 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl +++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl @@ -8,14 +8,15 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; $status = 0; $num_clients=40; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server_main", "-o $iorfile -n $num_clients"); + $SV = new PerlACE::ProcessVX ("server_main", "-o $iorfilebase -n $num_clients"); } else { $SV = new PerlACE::Process ("server_main", "-o $iorfile -n $num_clients"); @@ -29,7 +30,7 @@ if (PerlACE::waitforfile_timed ($iorfile, print STDERR "ERROR: cannot find file <$iorfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; -} +} for ($i = 0; $i < $num_clients; $i++) { @@ -48,7 +49,6 @@ for ($i = 0; $i < $num_clients; $i++) { } } - $server = $SV->WaitKill (60); if ($server != 0) { diff --git a/TAO/tests/CodeSets/simple/client.cpp b/TAO/tests/CodeSets/simple/client.cpp index 3a741b077c9..850cdc4664c 100644 --- a/TAO/tests/CodeSets/simple/client.cpp +++ b/TAO/tests/CodeSets/simple/client.cpp @@ -58,9 +58,7 @@ int main (int argc, char *argv[]) try { // Init the orb - CORBA::ORB_var orb= CORBA::ORB_init (argc, - argv, - ""); + CORBA::ORB_var orb= CORBA::ORB_init (argc, argv); // Get IOR from command line (or file) if (argc != 2) diff --git a/TAO/tests/CodeSets/simple/run_test.pl b/TAO/tests/CodeSets/simple/run_test.pl index 3988d59ed3a..996cb65a029 100755 --- a/TAO/tests/CodeSets/simple/run_test.pl +++ b/TAO/tests/CodeSets/simple/run_test.pl @@ -14,7 +14,9 @@ $status = 0; print STDOUT "Client using char translator\n\n"; -$SV = new PerlACE::Process ("server", " -ORBDottedDecimalAddresses 1"); +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SV = new $class ("server", " -ORBDottedDecimalAddresses 1"); $CL = new PerlACE::Process ("client", " -ORBSvcConf cs_test.conf"); $SV->Spawn (); @@ -26,14 +28,14 @@ if (PerlACE::waitforfile_timed ($iorfile, exit 1; } -$client = $CL->SpawnWaitKill (300); +$client = $CL->SpawnWaitKill (60); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; $status = 1; } -$server = $SV->WaitKill (10); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; @@ -44,7 +46,7 @@ unlink $iorfile; print STDOUT "\nServer using char translator\n\n"; -$SV2 = new PerlACE::Process ("server", " -ORBDottedDecimalAddresses 1 -ORBSvcConf cs_test.conf"); +$SV2 = new $class ("server", " -ORBDottedDecimalAddresses 1 -ORBSvcConf cs_test.conf"); $CL2 = new PerlACE::Process ("client"); $SV2->Spawn (); @@ -56,14 +58,14 @@ if (PerlACE::waitforfile_timed ($iorfile, exit 1; } -$client2 = $CL2->SpawnWaitKill (300); +$client2 = $CL2->SpawnWaitKill (60); if ($client2 != 0) { print STDERR "ERROR: client returned $client2\n"; $status = 1; } -$server2 = $SV2->WaitKill (10); +$server2 = $SV2->WaitKill (15); if ($server2 != 0) { print STDERR "ERROR: server returned $server2\n"; diff --git a/TAO/tests/CollocationLockup/CollocationLockup.cpp b/TAO/tests/CollocationLockup/CollocationLockup.cpp index d6b4e4a5dad..93a06008f59 100644 --- a/TAO/tests/CollocationLockup/CollocationLockup.cpp +++ b/TAO/tests/CollocationLockup/CollocationLockup.cpp @@ -97,6 +97,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) threads.spawn_n (N_THREADS, TestThread); ACE_DEBUG ((LM_INFO, "All threads spawned.\n")); + threads.wait (); + } //destructor of ACE_Thread_Manager = implicit join catch (CORBA::Exception& ex) { @@ -105,6 +107,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } g_pOrb->shutdown (0); + g_pOrb->destroy (); return 0; } diff --git a/TAO/tests/DIOP/run_test.pl b/TAO/tests/DIOP/run_test.pl index 689374ea71b..bfd22c0f235 100755 --- a/TAO/tests/DIOP/run_test.pl +++ b/TAO/tests/DIOP/run_test.pl @@ -22,14 +22,14 @@ $iorfile = PerlACE::LocalFile ($iorbase); if (PerlACE::is_vxworks_test()) { $TARGETHOSTNAME = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-ORBEndpoint diop://$TARGETHOSTNAME:8888 -o $iorbase -ORBdebuglevel $ORBdebuglevel -ORBDottedDecimalAddresses 1"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel -ORBDottedDecimalAddresses 1"); + $SV = new PerlACE::ProcessVX ("server", "-ORBEndpoint diop://$TARGETHOSTNAME:8888 -o $iorbase -ORBdebuglevel $ORBdebuglevel"); } else { $SV = new PerlACE::Process ("server", "-ORBEndpoint diop://:8888 -o $iorfile -ORBdebuglevel $ORBdebuglevel"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel"); } +$CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel"); + $SV->Spawn (); if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { diff --git a/TAO/tests/DIOP/run_test_ipv6.pl b/TAO/tests/DIOP/run_test_ipv6.pl index 2670b87d101..e28cb715d07 100755 --- a/TAO/tests/DIOP/run_test_ipv6.pl +++ b/TAO/tests/DIOP/run_test_ipv6.pl @@ -22,14 +22,14 @@ $iorfile = PerlACE::LocalFile ($iorbase); if (PerlACE::is_vxworks_test()) { $TARGETHOSTNAME = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-ORBEndpoint diop://$TARGETHOSTNAME:8888 -o $iorbase -ORBdebuglevel $ORBdebuglevel -ORBDottedDecimalAddresses 1"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel -ORBDottedDecimalAddresses 1"); + $SV = new PerlACE::ProcessVX ("server", "-ORBEndpoint diop://$TARGETHOSTNAME:8888 -o $iorbase -ORBdebuglevel $ORBdebuglevel"); } else { $SV = new PerlACE::Process ("server", "-ORBEndpoint diop://[::1]:8888 -o $iorfile -ORBdebuglevel $ORBdebuglevel"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel"); } +$CL = new PerlACE::Process ("client", "-k file://$iorfile -t 10 -i 10 -ORBdebuglevel $ORBdebuglevel"); + $SV->Spawn (); if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { diff --git a/TAO/tests/DSI_AMH/Roundtrip.cpp b/TAO/tests/DSI_AMH/Roundtrip.cpp index 058dc5d8e2d..b903e653b70 100644 --- a/TAO/tests/DSI_AMH/Roundtrip.cpp +++ b/TAO/tests/DSI_AMH/Roundtrip.cpp @@ -29,14 +29,14 @@ Roundtrip::invoke (CORBA::ServerRequest_ptr request, else if (ACE_OS::strcmp ("_is_a", request->operation ()) == 0) { - CORBA::NVList_var list; - this->orb_->create_list (0, list.out()); + CORBA::NVList_ptr list; + this->orb_->create_list (0, list); CORBA::Any type_id; type_id._tao_set_typecode (CORBA::_tc_string); list->add_value ("type_id", type_id, CORBA::ARG_IN); - request->arguments (list.inout()); + request->arguments (list); // list still has ownership of the item CORBA::NamedValue_ptr nv = list->item (0); @@ -64,14 +64,14 @@ Roundtrip::invoke (CORBA::ServerRequest_ptr request, else if (ACE_OS::strcmp ("test_method", request->operation ()) == 0) { - CORBA::NVList_var list; - this->orb_->create_list (0, list.out()); + CORBA::NVList_ptr list; // will become property of the arguments list + this->orb_->create_list (0, list); CORBA::Any send_time; send_time._tao_set_typecode (CORBA::_tc_ulonglong); list->add_value ("send_time", send_time, CORBA::ARG_IN); - request->arguments (list.inout()); + request->arguments (list); CORBA::NamedValue_ptr nv = list->item (0); diff --git a/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp b/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp index 6d031a17249..7afaf5d2873 100644 --- a/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp +++ b/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp @@ -78,16 +78,16 @@ void DSI_Simple_Server::invoke (CORBA::ServerRequest_ptr request, TAO_AMH_DSI_Response_Handler * rph) { - CORBA::NVList_var opList; - this->orb_->create_list (0, opList.out()); + CORBA::NVList_ptr opList; + this->orb_->create_list (0, opList); - request->arguments (opList.inout()); + request->arguments (opList); CORBA::Request_var target_request; this->target_->_create_request (0, // ctx request->operation (), - opList.in(), + opList, 0, // result 0, // exception_list, 0, // context_list, diff --git a/TAO/tests/GIOP_Fragments/PMB_With_Fragments/run_test.pl b/TAO/tests/GIOP_Fragments/PMB_With_Fragments/run_test.pl index a55136f2a0e..b1ba80d3890 100755 --- a/TAO/tests/GIOP_Fragments/PMB_With_Fragments/run_test.pl +++ b/TAO/tests/GIOP_Fragments/PMB_With_Fragments/run_test.pl @@ -46,7 +46,7 @@ if ($cl != 0) { ++$status; } -$server = $SV->WaitKill (10); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/IORManipulation/filter/run_test.pl b/TAO/tests/IORManipulation/filter/run_test.pl index 8b8709e9638..9e4ca4306ce 100755 --- a/TAO/tests/IORManipulation/filter/run_test.pl +++ b/TAO/tests/IORManipulation/filter/run_test.pl @@ -12,6 +12,8 @@ use Sys::Hostname; my $status = 0; my $host = hostname(); +my $host = (PerlACE::is_vxworks_test() ? $ENV{'ACE_RUN_VX_TGTHOST'} : + hostname()); my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : 'PerlACE::Process'); my $SV = $class->new('server', @@ -19,7 +21,7 @@ my $SV = $class->new('server', '-ORBEndpoint iiop://localhost ' . "-ORBEndpoint iiop://${host}"); -my $server = $SV->SpawnWaitKill(20); +my $server = $SV->SpawnWaitKill($PerlACE::wait_interval_for_process_creation); if ($server != 0) { print STDERR "ERROR: server returned $server \n"; diff --git a/TAO/tests/IORManipulation/run_test.pl b/TAO/tests/IORManipulation/run_test.pl index e2df5613d0e..9c5cca01e26 100755 --- a/TAO/tests/IORManipulation/run_test.pl +++ b/TAO/tests/IORManipulation/run_test.pl @@ -8,12 +8,9 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -if (PerlACE::is_vxworks_test()) { - $T = new PerlACE::ProcessVX ("IORTest"); -} -else { - $T = new PerlACE::Process ("IORTest"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$T = new $class ("IORTest"); $test = $T->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); diff --git a/TAO/tests/Leader_Followers/run_test.pl b/TAO/tests/Leader_Followers/run_test.pl index 7143445dee6..063b03d5af9 100755 --- a/TAO/tests/Leader_Followers/run_test.pl +++ b/TAO/tests/Leader_Followers/run_test.pl @@ -10,16 +10,22 @@ use PerlACE::Run_Test; $status = 0; $iorfile = PerlACE::LocalFile ("lf.ior"); -$tpool_reactor_directive = "-ORBsvcconfdirective \"static Advanced_Resource_Factory '-ORBreactortype tp'\""; -$select_reactor_directive = "-ORBsvcconfdirective \"static Advanced_Resource_Factory '-ORBreactortype select_mt'\""; +$tp_conf_base = "tp$PerlACE::svcconf_ext"; +$select_mt_conf_base = "select_mt$PerlACE::svcconf_ext"; +$tp_conf = PerlACE::LocalFile ("$tp_conf_base"); +$select_mt_conf = PerlACE::LocalFile ("$select_mt_conf_base"); if (PerlACE::is_vxworks_test()) { $sv_iorfile = "lf.ior"; $SV = new PerlACE::ProcessVX ("server"); + $tpool_reactor_directive = "-ORBsvcconf $tp_conf_base"; + $select_reactor_directive = "-ORBsvcconf $select_mt_conf_base"; } else { $sv_iorfile = $iorfile; $SV = new PerlACE::Process ("server"); + $tpool_reactor_directive = "-ORBsvcconf $tp_conf"; + $select_reactor_directive = "-ORBsvcconf $select_mt_conf"; } $CL = new PerlACE::Process ("client"); diff --git a/TAO/tests/Leader_Followers/select_mt.conf b/TAO/tests/Leader_Followers/select_mt.conf new file mode 100644 index 00000000000..8d22cd57f68 --- /dev/null +++ b/TAO/tests/Leader_Followers/select_mt.conf @@ -0,0 +1 @@ +static Advanced_Resource_Factory "-ORBreactortype select_mt" diff --git a/TAO/tests/Leader_Followers/tp.conf b/TAO/tests/Leader_Followers/tp.conf new file mode 100644 index 00000000000..b996e118b39 --- /dev/null +++ b/TAO/tests/Leader_Followers/tp.conf @@ -0,0 +1 @@ +static Advanced_Resource_Factory "-ORBreactortype tp" diff --git a/TAO/tests/LongDouble/run_test.pl b/TAO/tests/LongDouble/run_test.pl index e5b965587d3..d6f42a34e3a 100755 --- a/TAO/tests/LongDouble/run_test.pl +++ b/TAO/tests/LongDouble/run_test.pl @@ -16,12 +16,12 @@ foreach $i (@ARGV) { $debug_level = '10'; } } - -$iorfile = PerlACE::LocalFile ("server.ior"); +$iorfilebase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level -o server.ior"); + $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level -o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", "-ORBdebuglevel $debug_level -o $iorfile"); @@ -49,7 +49,7 @@ if ($client != 0) { $status = 1; } -$server = $SV->WaitKill (10); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/LongUpcalls/run_test.pl b/TAO/tests/LongUpcalls/run_test.pl index 8f96dc25d16..e520851168b 100755 --- a/TAO/tests/LongUpcalls/run_test.pl +++ b/TAO/tests/LongUpcalls/run_test.pl @@ -87,7 +87,7 @@ print STDERR "==== AMI Client, Server upcall waits for operations on other threa unlink $iorfile; $BSV->Spawn (); -if (PerlACE::waitforfile_timed ($iorfile, 30) == -1) { +if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: cannot find file <$iorfile>\n"; $BSV->Kill (); exit 1; diff --git a/TAO/tests/MT_BiDir/Receiver_i.cpp b/TAO/tests/MT_BiDir/Receiver_i.cpp index b8e19c0c9a0..cf6b1a2c027 100644 --- a/TAO/tests/MT_BiDir/Receiver_i.cpp +++ b/TAO/tests/MT_BiDir/Receiver_i.cpp @@ -17,7 +17,7 @@ Receiver_i::Receiver_i (void) void Receiver_i::receive_payload (const Receiver::Payload &payload) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); this->message_count_++; this->byte_count_ += payload.length (); } @@ -25,6 +25,6 @@ Receiver_i::receive_payload (const Receiver::Payload &payload) CORBA::Long Receiver_i::get_event_count (void) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); return this->message_count_; } diff --git a/TAO/tests/MT_BiDir/Sender_i.cpp b/TAO/tests/MT_BiDir/Sender_i.cpp index ba0c78d6c1a..2ebfaef6978 100644 --- a/TAO/tests/MT_BiDir/Sender_i.cpp +++ b/TAO/tests/MT_BiDir/Sender_i.cpp @@ -31,7 +31,7 @@ Sender_i::Sender_i (int no_clients, CORBA::Long Sender_i::receiver_object (Receiver_ptr recv) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_,-1); diff --git a/TAO/tests/MT_BiDir/run_test.pl b/TAO/tests/MT_BiDir/run_test.pl index 02ea1a066e9..49e512ef9b6 100755 --- a/TAO/tests/MT_BiDir/run_test.pl +++ b/TAO/tests/MT_BiDir/run_test.pl @@ -20,9 +20,9 @@ if (PerlACE::is_vxworks_test()) { else { $SV = new PerlACE::Process ("server", "-ORBSvcConf server$PerlACE::svcconf_ext -o $iorfile -c 3 -i 100"); } -$CL1 = new PerlACE::Process ("client", "-k file://$iorfile -ORBDottedDecimalAddresses 1"); -$CL2 = new PerlACE::Process ("client", "-k file://$iorfile -ORBDottedDecimalAddresses 1"); -$CL3 = new PerlACE::Process ("client", "-k file://$iorfile -ORBDottedDecimalAddresses 1"); +$CL1 = new PerlACE::Process ("client", "-k file://$iorfile"); +$CL2 = new PerlACE::Process ("client", "-k file://$iorfile"); +$CL3 = new PerlACE::Process ("client", "-k file://$iorfile"); $SV->Spawn (); diff --git a/TAO/tests/Multiple/client.cpp b/TAO/tests/Multiple/client.cpp index 0b2c982aa5c..d0050e5d8e3 100644 --- a/TAO/tests/Multiple/client.cpp +++ b/TAO/tests/Multiple/client.cpp @@ -1,21 +1,49 @@ // $Id$ # include "Collocation_Tester.h" +#include "ace/Get_Opt.h" ACE_RCSID (tests, client, "$Id$") -int main (int argc, char *argv[]) +const char *ior = "file://test.ior"; + +int +parse_args (int argc, char *argv[]) { + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} +int main (int argc, char *argv[]) +{ try { // ORB Initialization CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "TAO"); - CORBA::Object_var object; + if (parse_args (argc, argv) != 0) + return 1; - // Get The IOR from a file - object = orb->string_to_object ("file://s.ior"); + CORBA::Object_var object = orb->string_to_object (ior); if (CORBA::is_nil (object.in ())) { diff --git a/TAO/tests/Multiple/run_test.pl b/TAO/tests/Multiple/run_test.pl index d294b655cc9..8d601878a17 100755 --- a/TAO/tests/Multiple/run_test.pl +++ b/TAO/tests/Multiple/run_test.pl @@ -10,23 +10,25 @@ use PerlACE::Run_Test; $status = 0; -$direct_colloc = "-ORBCollocationStrategy direct"; -$no_colloc = "-ORBCollocation no"; - -# @todo Test should take -o and -k options to specify iorfile -# Hard coded in test. -$iorfile = "s.ior"; +$iorbase = "server.ior"; +$iorfile = PerlACE::LocalFile ("$iorbase"); unlink $iorfile; +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); if (PerlACE::is_vxworks_test()) { -$SV = new PerlACE::ProcessVX ("server"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorbase"); + $direct_colloc = "-ORBCollocationStrategy direct -o $iorbase"; + $no_colloc = "-ORBCollocation no -o $iorbase"; + } else { -$SV = new PerlACE::Process ("server"); + $SV = new PerlACE::Process ("server", "-o $iorfile"); + $direct_colloc = "-ORBCollocationStrategy direct -o $iorfile"; + $no_colloc = "-ORBCollocation no -o $iorfile"; } - -$CL = new PerlACE::Process ("client"); +$CL = new PerlACE::Process ("client", "-k file://$iorfile"); # # Test using ThruPOA collocation. diff --git a/TAO/tests/Multiple/server.cpp b/TAO/tests/Multiple/server.cpp index cb292790c4c..bd487099faf 100644 --- a/TAO/tests/Multiple/server.cpp +++ b/TAO/tests/Multiple/server.cpp @@ -1,14 +1,43 @@ // $Id$ #include "Multiple_Impl.h" +#include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" ACE_RCSID (tests, server, "$Id$") -int main (int argc, char *argv[]) +const char *ior_output_file = "test.ior"; + +int +parse_args (int argc, char *argv[]) { + ACE_Get_Opt get_opts (argc, argv, "o:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ try { // Orb Initialization @@ -19,10 +48,12 @@ int main (int argc, char *argv[]) PortableServer::POA_var poa = PortableServer::POA::_narrow(object.in()); - // Get the POAManager PortableServer::POAManager_var poa_manager = poa->the_POAManager(); + if (parse_args (argc, argv) != 0) + return 1; + // Create the servant. Bottom_Impl servant (orb.in ()); @@ -50,11 +81,12 @@ int main (int argc, char *argv[]) // If the ior_output_file exists, output the ior to it - FILE *output_file= ACE_OS::fopen ("s.ior", "w"); + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); if (output_file == 0) ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s"), + "Cannot open output file for writing IOR: %s", + ior_output_file), 1); ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); diff --git a/TAO/tests/Muxed_GIOP_Versions/server.cpp b/TAO/tests/Muxed_GIOP_Versions/server.cpp index 645166d9d5b..cceb353c6fc 100644 --- a/TAO/tests/Muxed_GIOP_Versions/server.cpp +++ b/TAO/tests/Muxed_GIOP_Versions/server.cpp @@ -115,7 +115,7 @@ private: int niterations_; - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; }; /***************************************************/ @@ -246,7 +246,7 @@ SelfClient::validate_connection (void) // Ping the object 100 times, ignoring all exceptions. // It would be better to use validate_connection() but the test must // run on minimum CORBA builds too! - ACE_GUARD (ACE_SYNCH_MUTEX, guard, mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, guard, mutex_); for (int j = 0; j != 100; ++j) { diff --git a/TAO/tests/Muxing/Receiver.cpp b/TAO/tests/Muxing/Receiver.cpp index b746df4426e..1ad5ab31565 100644 --- a/TAO/tests/Muxing/Receiver.cpp +++ b/TAO/tests/Muxing/Receiver.cpp @@ -15,7 +15,7 @@ Receiver::Receiver (CORBA::ORB_ptr orb) void Receiver::dump_results () { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); ACE_DEBUG ((LM_DEBUG, "Total messages = %d\n" "Total bytes = %d\n", @@ -26,7 +26,7 @@ Receiver::dump_results () void Receiver::receive_data (const Test::Payload &payload) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); this->message_count_++; this->byte_count_ += payload.length (); } @@ -34,7 +34,7 @@ Receiver::receive_data (const Test::Payload &payload) CORBA::Long Receiver::get_event_count (void) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); return this->message_count_; } diff --git a/TAO/tests/Muxing/Receiver.h b/TAO/tests/Muxing/Receiver.h index 87abf4b5082..a69e6d9fc5d 100644 --- a/TAO/tests/Muxing/Receiver.h +++ b/TAO/tests/Muxing/Receiver.h @@ -34,7 +34,7 @@ public: virtual void shutdown (void); private: - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; CORBA::ULong message_count_; CORBA::ULong byte_count_; /// Use an ORB reference to shutdown diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/client.cpp b/TAO/tests/NestedUpcall/MT_Client_Test/client.cpp index 51142c52e20..02eeb1b26f0 100644 --- a/TAO/tests/NestedUpcall/MT_Client_Test/client.cpp +++ b/TAO/tests/NestedUpcall/MT_Client_Test/client.cpp @@ -65,7 +65,7 @@ MT_Client::read_ior (char *filename) if (f_handle == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for reading: %p\n", + "Unable to open %s for reading\n", filename), -1); @@ -105,7 +105,7 @@ MT_Client::parse_args (void) // read IOR for MT Object if (result < 0) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior from %s : %p\n", + "Unable to read ior from %s\n", get_opts.opt_arg ()), -1); } @@ -117,7 +117,7 @@ MT_Client::parse_args (void) // read IOR for Object A if (result < 0) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior from %s : %p\n", + "Unable to read ior from %s\n", get_opts.opt_arg ()), -1); } @@ -217,7 +217,6 @@ MT_Client::init (int argc, char **argv, "The IOR is nil, not able to get the object.\n"), -1); - CORBA::Object_var object_var = this->orb_var_->string_to_object (this->object_key_); @@ -269,6 +268,8 @@ MT_Client::init (int argc, char **argv, int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { + int result = 0; + try { TAO_ORB_Manager orb_manager; @@ -319,7 +320,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) "MT_Client_Task.\n"), -1); // @@ Memory leak! - int result = ACE_Thread_Manager::instance ()->wait (); + result = ACE_Thread_Manager::instance ()->wait (); for (i = 0; i < threads; i++) delete clients[i]; @@ -331,12 +332,12 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) delete server; - return result; + orb_manager.fini (); } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("main"); } - return 1; + return result; } diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/local_server.cpp b/TAO/tests/NestedUpcall/MT_Client_Test/local_server.cpp index d6643c11fe2..cc3fbd7a792 100644 --- a/TAO/tests/NestedUpcall/MT_Client_Test/local_server.cpp +++ b/TAO/tests/NestedUpcall/MT_Client_Test/local_server.cpp @@ -66,7 +66,7 @@ MT_Server::read_ior (char *filename) if (f_handle == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for reading: %p\n", + "Unable to open %s for reading\n", filename), -1); diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl index 7f765949bfa..adcc580eb47 100755 --- a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl +++ b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl @@ -9,7 +9,8 @@ use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; $status = 0; -$ior1file = PerlACE::LocalFile ("server1.ior"); +$ior1filebase = "server1.ior"; +$ior1file = PerlACE::LocalFile ("$ior1filebase"); $ior2file = PerlACE::LocalFile ("server2.ior"); # Make sure the files are gone @@ -17,7 +18,7 @@ unlink $ior1file; unlink $ior2file; if (PerlACE::is_vxworks_test()) { - $SV1 = new PerlACE::ProcessVX ("server", "-o server1.ior"); + $SV1 = new PerlACE::ProcessVX ("server", "-o $ior1filebase"); } else { $SV1 = new PerlACE::Process ("server", "-o $ior1file"); diff --git a/TAO/tests/Nested_Event_Loop/run_test.pl b/TAO/tests/Nested_Event_Loop/run_test.pl index f78b58c7d70..6b6efad7e29 100755 --- a/TAO/tests/Nested_Event_Loop/run_test.pl +++ b/TAO/tests/Nested_Event_Loop/run_test.pl @@ -15,14 +15,14 @@ $iorfile = PerlACE::LocalFile ($baseior); unlink $iorfile; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o $baseior -ORBDottedDecimalAddresses 1"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -x -ORBDottedDecimalAddresses 1"); + $SV = new PerlACE::ProcessVX ("server", "-o $baseior"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile"); - $CL = new PerlACE::Process ("client", "-k file://$iorfile -x"); } +$CL = new PerlACE::Process ("client", "-k file://$iorfile -x"); + $SV->Spawn (); if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { diff --git a/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc b/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc index 0327652d82d..31824d238ea 100644 --- a/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc +++ b/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc @@ -10,7 +10,7 @@ project(*idl): taoidldefaults { project(*Server): taoserver, messaging { after += *idl - specific(bmake, borland, nmake, em3, vc6, vc71, vc8) { + specific(bmake, borland, nmake, em3, vc6, vc71, vc8, vc9) { // Use a roughly 16MB stack to avoid stack overflow in this test StackReserveSize = 16000000 } diff --git a/TAO/tests/ORB_destroy/run_test.pl b/TAO/tests/ORB_destroy/run_test.pl index 8434e081af1..651c3fa1ac9 100755 --- a/TAO/tests/ORB_destroy/run_test.pl +++ b/TAO/tests/ORB_destroy/run_test.pl @@ -8,12 +8,9 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -if (PerlACE::is_vxworks_test()) { - $T = new PerlACE::ProcessVX ("ORB_destroy"); -} -else { - $T = new PerlACE::Process ("ORB_destroy"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$T = new $class ("ORB_destroy"); $test = $T->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); diff --git a/TAO/tests/ORB_init/run_test.pl b/TAO/tests/ORB_init/run_test.pl index f9b2781b422..72f31cb0545 100755 --- a/TAO/tests/ORB_init/run_test.pl +++ b/TAO/tests/ORB_init/run_test.pl @@ -8,12 +8,9 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -if (PerlACE::is_vxworks_test()) { - $T = new PerlACE::ProcessVX ("ORB_init"); -} -else { - $T = new PerlACE::Process ("ORB_init"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$T = new $class ("ORB_init"); $test = $T->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); diff --git a/TAO/tests/POA/Deactivate_Object/run_test.pl b/TAO/tests/POA/Deactivate_Object/run_test.pl index 2b56e9924db..5939bda2874 100755 --- a/TAO/tests/POA/Deactivate_Object/run_test.pl +++ b/TAO/tests/POA/Deactivate_Object/run_test.pl @@ -10,12 +10,9 @@ use PerlACE::Run_Test; $status = 0; -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server"); -} -else { - $SV = new PerlACE::Process ("server"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$SV = new $class ("server"); $server = $SV->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); diff --git a/TAO/tests/POA/Default_Servant2/client.cpp b/TAO/tests/POA/Default_Servant2/client.cpp index 1cda2e72120..0abcf751e34 100644 --- a/TAO/tests/POA/Default_Servant2/client.cpp +++ b/TAO/tests/POA/Default_Servant2/client.cpp @@ -121,7 +121,7 @@ main (int argc, char **argv) // write the message to the file fd->write (data_sent); - //seek to the beginning of the file + // seek to the beginning of the file fd->lseek (0, SEEK_SET); // Read back the written message diff --git a/TAO/tests/POA/wait_for_completion/run_test.pl b/TAO/tests/POA/wait_for_completion/run_test.pl index 8b5cd957c73..f664fb47d21 100755 --- a/TAO/tests/POA/wait_for_completion/run_test.pl +++ b/TAO/tests/POA/wait_for_completion/run_test.pl @@ -8,12 +8,9 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -if (PerlACE::is_vxworks_test()) { - $T = new PerlACE::ProcessVX ("wait_for_completion"); -} -else { - $T = new PerlACE::Process ("wait_for_completion"); -} +my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : + 'PerlACE::Process'); +$T = new $class ("wait_for_completion"); $test = $T->SpawnWaitKill ($PerlACE::wait_interval_for_process_creation); diff --git a/TAO/tests/Param_Test/anyop.cpp b/TAO/tests/Param_Test/anyop.cpp index 2ef33f6fdcc..86b01f65b47 100644 --- a/TAO/tests/Param_Test/anyop.cpp +++ b/TAO/tests/Param_Test/anyop.cpp @@ -23,6 +23,7 @@ // Not normally needed, but we create an object reference in this test, // and we have to narrow it. #include "tao/Object_T.h" +#include "tao/Stub.h" #include "ace/Get_Opt.h" diff --git a/TAO/tests/Param_Test/options.cpp b/TAO/tests/Param_Test/options.cpp index 493e73dfa7c..2bd26e08726 100644 --- a/TAO/tests/Param_Test/options.cpp +++ b/TAO/tests/Param_Test/options.cpp @@ -22,6 +22,7 @@ #include "ace/Get_Opt.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_fcntl.h" +#include "ace/Log_Msg.h" ACE_RCSID (Param_Test, options, diff --git a/TAO/tests/Param_Test/server.cpp b/TAO/tests/Param_Test/server.cpp index 59de4d8d5ff..6dde3f0571a 100644 --- a/TAO/tests/Param_Test/server.cpp +++ b/TAO/tests/Param_Test/server.cpp @@ -154,11 +154,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) orb_ptr->run (); - good_poa->destroy (1, - 1); + good_poa->destroy (1, 1); - oa_ptr->destroy (1, - 1); + oa_ptr->destroy (1, 1); } catch (const CORBA::SystemException& sysex) { diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/Bug_2133.mpc b/TAO/tests/Portable_Interceptors/Bug_2133/Bug_2133.mpc new file mode 100644 index 00000000000..4e3a62f3f1e --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/Bug_2133.mpc @@ -0,0 +1,39 @@ +// -*- MPC -*- +// $Id$ + +project(*idl): taoidldefaults { + idlflags += -Sp + IDL_Files { + Test.idl + } + custom_only = 1 +} + +project(*Server): taoserver { + after += *idl + Source_Files { + Hello.cpp + server.cpp + } + Source_Files { + TestC.cpp + TestS.cpp + } + IDL_Files { + } +} + +project(*Client): taoclient, pi { + after += *idl + Source_Files { + ClientORBInitializer.cpp + ClientRequest_Interceptor.cpp + client.cpp + } + Source_Files { + TestC.cpp + } + IDL_Files { + } +} + diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.cpp new file mode 100644 index 00000000000..2f4406185c9 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.cpp @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +#include "ClientORBInitializer.h" + +void +ClientORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) +{ + // No-op +} + +void +ClientORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info) +{ + PortableInterceptor::ClientRequestInterceptor_ptr cri = + PortableInterceptor::ClientRequestInterceptor::_nil (); + + ACE_NEW_THROW_EX (cri, + ClientRequest_Interceptor, + CORBA::NO_MEMORY ()); + + PortableInterceptor::ClientRequestInterceptor_var + client_interceptor = cri; + + info->add_client_request_interceptor (client_interceptor.in ()); + +} diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.h new file mode 100644 index 00000000000..6061aad9dd0 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/ClientORBInitializer.h @@ -0,0 +1,50 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ClientORBInitializer.h + * + * $Id$ + */ +//============================================================================= +#ifndef CLIENTORBINITIALIZER_H +#define CLIENTORBINITIALIZER_H + +#include /**/ "ace/pre.h" + +#include "tao/PortableInterceptorC.h" +#include "ClientRequest_Interceptor.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PI/PI.h" +#include "tao/LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +/// RTCORBA ORB initializer. +class ClientORBInitializer : + public virtual PortableInterceptor::ORBInitializer, + public virtual TAO_Local_RefCounted_Object +{ +public: + + virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info); + + virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info); +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" + +#endif /* CLIENTORBINITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.cpp new file mode 100644 index 00000000000..40c7b1b6a32 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.cpp @@ -0,0 +1,89 @@ +// $Id$ + +#include "ClientRequest_Interceptor.h" + +#include "tao/CORBA_String.h" +#include "tao/debug.h" +#include "ace/Log_Msg.h" + + CORBA::Boolean + ClientRequest_Interceptor::success_flag_ = 0; + + ClientRequest_Interceptor::ClientRequest_Interceptor (void) + : name_ ("ClientRequest_Interceptor") + { + } + + ClientRequest_Interceptor::~ClientRequest_Interceptor (void) + { + } + + char * + ClientRequest_Interceptor::name () + { + return CORBA::string_dup (this->name_); + } + + void + ClientRequest_Interceptor::destroy () + { + // No-op + } + + void + ClientRequest_Interceptor::send_poll ( + PortableInterceptor::ClientRequestInfo_ptr ri + ) + { + // Print debug + CORBA::String_var op = + ri->operation (); + + + ACE_DEBUG ((LM_DEBUG, + "TAO_FT (%P|%t): ClientRequest_Interceptor::send_poll called for operation: %s \n", + op.in ())); + } + + void + ClientRequest_Interceptor::send_request ( + PortableInterceptor::ClientRequestInfo_ptr ri) + { + // Print debug + CORBA::String_var op = + ri->operation (); + + + ACE_DEBUG ((LM_DEBUG, + "ClientRequest_Interceptor::send_request called for operation: %s - things are going well...\n", + op.in ())); + } + + void + ClientRequest_Interceptor::receive_reply ( + PortableInterceptor::ClientRequestInfo_ptr) + { + // No-op + } + + void + ClientRequest_Interceptor::receive_other ( + PortableInterceptor::ClientRequestInfo_ptr) + { + // No-op + } + + void + ClientRequest_Interceptor::receive_exception ( + PortableInterceptor::ClientRequestInfo_ptr ri) + { + // Print debug + CORBA::String_var op = + ri->operation (); + + + ACE_DEBUG ((LM_DEBUG, + "ClientRequest_Interceptor::receive_exception called for operation: %s - test has succeeded...\n", + op.in ())); + success_flag_ = 1; + } diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.h b/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.h new file mode 100644 index 00000000000..b1aaaec8fd7 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/ClientRequest_Interceptor.h @@ -0,0 +1,68 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file ClientRequest_Interceptor.h + * + * $Id$ + */ +//============================================================================= +#ifndef CLIENTREQUEST_INTERCEPTOR_H +#define CLIENTREQUEST_INTERCEPTOR_H +#include /**/ "ace/pre.h" + +#include "tao/PI/PI.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +/** +* @class ClientRequest_Interceptor +* +*/ +class ClientRequest_Interceptor +: public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ +public: + +ClientRequest_Interceptor (void); + +~ClientRequest_Interceptor (void); + +/// Canonical name of the interceptor. +virtual char * name (); + + +virtual void destroy (); + +virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr); + +virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri); + +virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri); + +virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri); + +virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri); + +static CORBA::Boolean success_flag_; + +private: + +/// Name of the interceptor +const char *name_; + +}; +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" +#endif /*CLIENTREQUEST_INTERCEPTOR_H*/ + diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/Hello.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/Hello.cpp new file mode 100644 index 00000000000..7b9497529ec --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/Hello.cpp @@ -0,0 +1,23 @@ +// +// $Id$ +// +#include "Hello.h" + +ACE_RCSID(Hello, Hello, "Hello.cpp,v 1.3 2002/01/29 20:21:07 okellogg Exp") + +Hello::Hello (CORBA::ORB_ptr orb) + : orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +char * +Hello::get_string () +{ + return CORBA::string_dup ("Hello there!"); +} + +void +Hello::shutdown () +{ + this->orb_->shutdown (0 ); +} diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/Hello.h b/TAO/tests/Portable_Interceptors/Bug_2133/Hello.h new file mode 100644 index 00000000000..782b1b2f573 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/Hello.h @@ -0,0 +1,31 @@ +// +// $Id$ +// + +#ifndef HELLO_H +#define HELLO_H +#include /**/ "ace/pre.h" + +#include "TestS.h" + +/// Implement the Test::Hello interface +class Hello + : public virtual POA_Test::Hello +{ +public: + /// Constructor + Hello (CORBA::ORB_ptr orb); + + // = The skeleton methods + virtual char * get_string (); + + virtual void shutdown (); + +private: + /// Use an ORB reference to conver strings to objects and shutdown + /// the application. + CORBA::ORB_var orb_; +}; + +#include /**/ "ace/post.h" +#endif /* HELLO_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/README b/TAO/tests/Portable_Interceptors/Bug_2133/README new file mode 100644 index 00000000000..b2d570b8158 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/README @@ -0,0 +1,12 @@ +$Id$ + +This test attempts to contact a server IOR with no connectable profile in it (on account of how there is no server running). + +The method invocation should fail but the installed client request interceptor should have its send_request and receive_exception methods invoked regardless. + +The expected result looks like: + +Client about to make method call that is doomed to failure... +ClientRequest_Interceptor::send_request called for operation: get_string - things are going well... +ClientRequest_Interceptor::receive_exception called for operation: get_string - test has succeeded... +Success - the server was unreachable and PI receive_exception was invoked. diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/Test.idl b/TAO/tests/Portable_Interceptors/Bug_2133/Test.idl new file mode 100644 index 00000000000..3c0976e106d --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/Test.idl @@ -0,0 +1,20 @@ +// +// $Id$ +// + +/// Put the interfaces in a module, to avoid global namespace pollution +module Test +{ + /// A very simple interface + interface Hello + { + /// Return a simple string + string get_string (); + + /// A method to shutdown the ORB + /** + * This method is used to simplify the test shutdown process + */ + oneway void shutdown (); + }; +}; diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp new file mode 100644 index 00000000000..0b93485f578 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp @@ -0,0 +1,109 @@ +// $Id$ + +#include "TestC.h" +#include "ace/Get_Opt.h" +#include "tao/PortableInterceptorC.h" +#include "ClientORBInitializer.h" +#include "tao/ORBInitializer_Registry.h" + + +ACE_RCSID(Hello, client, "client.cpp,v 1.5 2002/01/29 20:21:07 okellogg Exp") + +const char *ior = "file://test.ior"; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +main (int argc, char *argv[]) +{ + try + { + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + PortableInterceptor::ORBInitializer_var orb_initializer; + + // Register the ClientRequest_Interceptor ORBInitializer. + ACE_NEW_RETURN (temp_orb_initializer, + ClientORBInitializer, + -1); + + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in ()); + + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ); + + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var tmp = + orb->string_to_object(ior ); + + + Test::Hello_var hello = + Test::Hello::_narrow(tmp.in () ); + + + if (CORBA::is_nil (hello.in ())) + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Test::Hello reference <%s>\n", + ior), + 1); + } + + ACE_DEBUG ((LM_DEBUG, "Client about to make method call that is doomed to failure...\n")); + + CORBA::String_var the_string = + hello->get_string (); + + + ACE_ERROR_RETURN ((LM_DEBUG, + "Error - the remote call succeeded which is bloody miraculous given that no server is running !!\n", + ior), + 1); + } + catch (const CORBA::Exception&) + { + if (ClientRequest_Interceptor::success_flag_) + { + ACE_DEBUG ((LM_DEBUG, "Success - the server was unreachable and PI receive_exception was invoked.\n")); + return 0; + } + else + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Error: regression failed - interceptor receive_exception interception point was not invoked !!\n"), + 1); + } + } + + + return 1; +} diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_2133/run_test.pl new file mode 100755 index 00000000000..6b8c97780fa --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/run_test.pl @@ -0,0 +1,67 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $target = PerlACE::TestTarget::create_target ($PerlACE::TestConfig); + +$iorbase = "server.ior"; +$iorfile = $target->LocalFile ("$iorbase"); +$target->DeleteFile($iorfile); + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("server", "-ORBDebuglevel $debug_level -o $iorbase"); +} +else { + $SV = $target->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $iorfile"); +} +$CL = $target->CreateProcess ("client", " -k file://$iorfile"); + +$server = $SV->Spawn (); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + exit 1; +} + +if ($target->WaitForFileTimed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +$target->GetStderrLog(); + +$target->DeleteFile($iorfile); + +exit $status; diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/server.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/server.cpp new file mode 100644 index 00000000000..35629b06b9f --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2133/server.cpp @@ -0,0 +1,100 @@ +// $Id$ + +#include "Hello.h" +#include "ace/Get_Opt.h" +#include "ace/OS_NS_stdio.h" +//#include "tao/Strategies/advanced_resource.h" + +ACE_RCSID (Hello, + server, + "server.cpp,v 1.6 2003/11/01 11:15:11 dhinton Exp") + +const char *ior_output_file = "test.ior"; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "o:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +main (int argc, char *argv[]) +{ + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ); + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA" ); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () ); + + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Panic: nil RootPOA\n"), + 1); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + if (parse_args (argc, argv) != 0) + return 1; + + Hello *hello_impl = 0; + ACE_NEW_RETURN (hello_impl, + Hello (orb.in ()), + 1); + PortableServer::ServantBase_var owner_transfer(hello_impl); + + Test::Hello_var hello = + hello_impl->_this (); + + CORBA::String_var ior = + orb->object_to_string (hello.in () ); + + // Output the IOR to the <ior_output_file> + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + + root_poa->destroy (1, 1 ); + + orb->destroy (); + + ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp index b2354197f86..f05d89d2d54 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp @@ -2,6 +2,7 @@ #include "ace/Get_Opt.h" #include "ace/Synch.h" +#include "ace/Thread.h" #include "testC.h" #include "Client_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Bug_3079/Client_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_3079/Client_Request_Interceptor.cpp index f05b14c5bc9..a5ee111ebe7 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3079/Client_Request_Interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3079/Client_Request_Interceptor.cpp @@ -58,7 +58,7 @@ Client_Request_Interceptor::receive_exception ( PortableInterceptor::ClientRequestInfo_ptr ri) { ++this->exception_count_; - ACE_DEBUG ((LM_DEBUG, "RECEIVED EXCEPTION %d\n", + ACE_DEBUG ((LM_DEBUG, "received exception %d\n", this->exception_count_)); if (CORBA::is_nil (this->orb_.in ())) { @@ -70,6 +70,7 @@ Client_Request_Interceptor::receive_exception ( if (this->exception_count_ == 1) { + ACE_DEBUG ((LM_DEBUG, "forwarding client to the second server\n")); CORBA::Object_var first_forward = this->orb_->string_to_object (this->first_forward_str_.in ()); @@ -78,6 +79,7 @@ Client_Request_Interceptor::receive_exception ( } else if (this->exception_count_ == 2) { + ACE_DEBUG ((LM_DEBUG, "forwarding client to the third server\n")); CORBA::Object_var second_forward = this->orb_->string_to_object (this->second_forward_str_.in ()); diff --git a/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl index 57b11e609a4..4da4dfdb766 100755 --- a/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl +++ b/TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl @@ -10,7 +10,8 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$file1 = PerlACE::LocalFile ("test1.ior"); +$file1base = "test1.ior"; +$file1 = PerlACE::LocalFile ("$file1base"); $file2 = PerlACE::LocalFile ("test2.ior"); $file3 = PerlACE::LocalFile ("test3.ior"); @@ -19,7 +20,7 @@ unlink $file2; unlink $file3; if (PerlACE::is_vxworks_test()) { -$SV1 = new PerlACE::ProcessVX ("server", "-o test1.ior -c 1 -n 1"); +$SV1 = new PerlACE::ProcessVX ("server", "-o $file1base -c 1 -n 1 -s 1"); } else { $SV1 = new PerlACE::Process ("server", "-o $file1 -c 1 -n 1 -s 1"); @@ -31,7 +32,7 @@ $CL = new PerlACE::Process ("client", $status = 0; -print STDERR "\n\n==== Running PortableInterceptor::Redirection test\n"; +print STDERR "\n\n==== Running PortableInterceptor::Bug_3079 test\n"; $SV1->Spawn (); $SV2->Spawn (); @@ -62,7 +63,7 @@ if ($client != 0) { $status = 1; } -$server1 = $SV1->WaitKill (5); +$server1 = $SV1->WaitKill (15); # The first server will crash by design and in such instance it will # return the magic number 1. The test must not interpret it as an @@ -78,7 +79,7 @@ if ($server1 != 0) { } } -$server2 = $SV2->WaitKill (5); +$server2 = $SV2->WaitKill (15); # The second server will crash by design and in such instance it will # return the magic number 1. The test must not interpret it as an @@ -93,7 +94,7 @@ if ($server2 != 0) { } } -$server3 = $SV3->WaitKill (5); +$server3 = $SV3->WaitKill (15); if ($server3 != 0) { print STDERR "ERROR: server3 returned $server3\n"; diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/server.cpp b/TAO/tests/Portable_Interceptors/Bug_3080/server.cpp index b3278714c74..fc6de02fa77 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/server.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3080/server.cpp @@ -83,7 +83,11 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); + root_poa->destroy (1, 1 ); + + orb->destroy (); + + ACE_DEBUG ((LM_DEBUG, "Server event loop finished.\n")); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp index 09f9419c5d2..b5a7b63a0c4 100644 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp @@ -18,8 +18,7 @@ Client_ORBInitializer::Client_ORBInitializer (Client_ORBInitializer *second) : } void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr) +Client_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) { ++pre_init_called; @@ -34,8 +33,7 @@ Client_ORBInitializer::pre_init ( } void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr) +Client_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr) { ++post_init_called; } diff --git a/TAO/tests/Portable_Interceptors/Redirection/run_test.pl b/TAO/tests/Portable_Interceptors/Redirection/run_test.pl index 885806bbdce..89aeae50a11 100755 --- a/TAO/tests/Portable_Interceptors/Redirection/run_test.pl +++ b/TAO/tests/Portable_Interceptors/Redirection/run_test.pl @@ -10,14 +10,15 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::Run_Test; -$file1 = PerlACE::LocalFile ("test1.ior"); +$file1base = "test.ior"; +$file1 = PerlACE::LocalFile ("$file1base"); $file2 = PerlACE::LocalFile ("test2.ior"); unlink $file1; unlink $file2; if (PerlACE::is_vxworks_test()) { -$SV1 = new PerlACE::ProcessVX ("server", "-o test1.ior -c 1 -n 1"); +$SV1 = new PerlACE::ProcessVX ("server", "-o $file1base -c 1 -n 1"); } else { $SV1 = new PerlACE::Process ("server", "-o $file1 -c 1 -n 1"); @@ -30,7 +31,6 @@ $status = 0; print STDERR "\n\n==== Running PortableInterceptor::Redirection test\n"; $SV1->Spawn (); -$SV2->Spawn (); if (PerlACE::waitforfile_timed ($file1, $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: cannot find file <$file1>\n"; @@ -38,6 +38,8 @@ if (PerlACE::waitforfile_timed ($file1, $PerlACE::wait_interval_for_process_crea exit 1; } +$SV2->Spawn (); + if (PerlACE::waitforfile_timed ($file2, $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: cannot find file <$file2>\n"; $SV2->Kill (); @@ -67,7 +69,7 @@ if ($server1 != 0) { } } -$server2 = $SV2->WaitKill (5); +$server2 = $SV2->WaitKill (15); if ($server2 != 0) { print STDERR "ERROR: server2 returned $server2\n"; diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/run_test.pl b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/run_test.pl index 2032857125b..3c9e0d22062 100644 --- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/run_test.pl +++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/run_test.pl @@ -59,7 +59,6 @@ else { if ($continuous) { $SV->Arguments ("-ORBSvcConf continuous$PerlACE::svcconf_ext"); } - $SV->Arguments ("-ORBDebugLevel 10 -ORBLogFile server.log"); $SV->Spawn (); diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf index c288d674567..d3e71e1da4b 100644 --- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf +++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf @@ -1 +1 @@ -static RT_ORB_Loader "-RTORBDynamicThreadIdleTimeout 1000000" +static RT_ORB_Loader "-RTORBDynamicThreadIdleTimeout 100000" diff --git a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf.xml b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf.xml index 0908328040b..24f6033f25e 100644 --- a/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf.xml +++ b/TAO/tests/RTCORBA/Dynamic_Thread_Pool/svc.conf.xml @@ -1,5 +1,5 @@ <?xml version='1.0'?> <!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <static RT_ORB_Loader "-RTORBDynamicThreadIdleTimeout 1000000"> + <static RT_ORB_Loader "-RTORBDynamicThreadIdleTimeout 100000"> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl index 1f6905d4d44..2ccabdd6f4c 100755 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl @@ -17,7 +17,8 @@ if ($#ARGV >= 0 && $ARGV[0] eq '-q') { } # Test parameters. -$iorfile = PerlACE::LocalFile ("test.ior"); +$iorfilebase = "test.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); $data_file = PerlACE::LocalFile ("test_run.data"); $debug_level = 1; @@ -58,7 +59,7 @@ $client_args = ."-a $priority1 -b $priority2 -e 1413566210 -f 0 -n $iterations"; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior $server_args"); + $SV = new PerlACE::ProcessVX ("server", "-o $iorfilebase $server_args"); } else { $SV = new PerlACE::Process ("server", "-o $iorfile $server_args"); diff --git a/TAO/tests/Servant_To_Reference_Test/run_test.pl b/TAO/tests/Servant_To_Reference_Test/run_test.pl index 8418895af5c..91045fa2fcc 100755 --- a/TAO/tests/Servant_To_Reference_Test/run_test.pl +++ b/TAO/tests/Servant_To_Reference_Test/run_test.pl @@ -22,7 +22,7 @@ else { $SV->Spawn (); ## Slower hardware can require much more time to complete. -$server = $SV->WaitKill (90); +$server = $SV->WaitKill ($PerlACE::wait_interval_for_process_creation); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Server_Connection_Purging/run_test.pl b/TAO/tests/Server_Connection_Purging/run_test.pl index d7d69f85562..ccaf6a19c58 100755 --- a/TAO/tests/Server_Connection_Purging/run_test.pl +++ b/TAO/tests/Server_Connection_Purging/run_test.pl @@ -13,14 +13,14 @@ $orbport = 10000 + PerlACE::uniqueid (); unlink $iorfile; $status = 0; -$endpoint = "-ORBEndpoint iiop://localhost:$orbport"; -$clientarg = "-h localhost -p $orbport"; if (PerlACE::is_vxworks_test()) { $endpoint = "-ORBEndpoint iiop://".$ENV{'ACE_RUN_VX_TGTHOST'}.":$orbport"; $clientarg = "-h ".$ENV{'ACE_RUN_VX_TGTHOST'}." -p $orbport"; $SV = new PerlACE::ProcessVX ("server", "$endpoint"); } else { +$endpoint = "-ORBEndpoint iiop://localhost:$orbport"; +$clientarg = "-h localhost -p $orbport"; $SV = new PerlACE::Process ("server", "$endpoint"); } diff --git a/TAO/tests/Smart_Proxies/Policy/run_test.pl b/TAO/tests/Smart_Proxies/Policy/run_test.pl index 082291c76cc..19d44e96cee 100755 --- a/TAO/tests/Smart_Proxies/Policy/run_test.pl +++ b/TAO/tests/Smart_Proxies/Policy/run_test.pl @@ -101,7 +101,7 @@ if ($client != 0) { $status = 1; } -$server = $SV1->WaitKill (10); +$server = $SV1->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server 1 returned $server\n"; @@ -110,7 +110,7 @@ if ($server != 0) { unlink $iorfile1; -$server = $SV2->WaitKill (10); +$server = $SV2->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server 2 returned $server\n"; diff --git a/TAO/tests/Stack_Recursion/Sender.cpp b/TAO/tests/Stack_Recursion/Sender.cpp index f9e47df0972..e82205e3e05 100644 --- a/TAO/tests/Stack_Recursion/Sender.cpp +++ b/TAO/tests/Stack_Recursion/Sender.cpp @@ -18,7 +18,7 @@ Sender::Sender (CORBA::ORB_ptr orb) void Sender::dump_results (void) { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); ACE_DEBUG ((LM_DEBUG, "Total messages = %d\n" "Total bytes = %d\n", @@ -36,7 +36,7 @@ CORBA::Boolean Sender::get_data (CORBA::ULong size, Test::Payload_out payload) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); @@ -53,7 +53,7 @@ Sender::get_data (CORBA::ULong size, CORBA::Long Sender::get_event_count (void) { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); @@ -72,7 +72,7 @@ Sender::shutdown (void) { if (this->is_done_ == false) { - ACE_GUARD (ACE_SYNCH_MUTEX, + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); diff --git a/TAO/tests/Stack_Recursion/Sender.h b/TAO/tests/Stack_Recursion/Sender.h index 8e66804cd41..5af96f9d9b5 100644 --- a/TAO/tests/Stack_Recursion/Sender.h +++ b/TAO/tests/Stack_Recursion/Sender.h @@ -36,7 +36,7 @@ public: virtual void shutdown (void); private: - ACE_SYNCH_MUTEX mutex_; + TAO_SYNCH_MUTEX mutex_; CORBA::ULong message_count_; CORBA::ULong byte_count_; CORBA::ORB_var orb_; diff --git a/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp b/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp index b0cdb5507ea..0697c11ac4c 100644 --- a/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp +++ b/TAO/tests/TransportCurrent/Framework/Current_Test_Impl.cpp @@ -30,10 +30,11 @@ Current_Test_Impl::self_test (void) void Current_Test_Impl::test_transport_current (void) { - if (TAO_debug_level > 2) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) server - Testing access to Transport Current ...\n"))); - } + if (TAO_debug_level > 2) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) server - Testing access to Transport Current ...\n"))); + } CORBA::Object_var tcobject = orb_->resolve_initial_references ("TAO::Transport::Current"); @@ -62,10 +63,11 @@ Current_Test_Impl::test_transport_current (void) (ACE_UINT64)rr)); } - if (TAO_debug_level > 2) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) server - Successfully accessed Transport Current\n"))); - } + if (TAO_debug_level > 2) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) server - Successfully accessed Transport Current\n"))); + } } void diff --git a/TAO/tests/TransportCurrent/Framework/run_test.pl b/TAO/tests/TransportCurrent/Framework/run_test.pl index 82bab369536..e57d588458e 100755 --- a/TAO/tests/TransportCurrent/Framework/run_test.pl +++ b/TAO/tests/TransportCurrent/Framework/run_test.pl @@ -20,14 +20,6 @@ sub add_path { } } -# Set the library path for the client to be able to load -# the commom library. -add_path('LD_LIBRARY_PATH', '../lib'); -add_path('LIBPATH', '../lib'); -add_path('SHLIB_PATH', '../lib'); -add_path('PATH', '../lib'); -add_path('DYLD_LIBRARY_PATH', '../lib'); - my $status = 0; my $confmod = ""; @@ -72,7 +64,7 @@ if (PerlACE::waitforfile_timed ($iorfile, } print STDERR $CL->CommandLine()."\n"; -$client = $CL->SpawnWaitKill (300); +$client = $CL->SpawnWaitKill (60); if ($client != 0) { print STDERR "$0: ERROR: client returned $client\n"; diff --git a/TAO/tests/TransportCurrent/IIOP/run_test.pl b/TAO/tests/TransportCurrent/IIOP/run_test.pl index c455b9938bf..bf6740196f4 100755 --- a/TAO/tests/TransportCurrent/IIOP/run_test.pl +++ b/TAO/tests/TransportCurrent/IIOP/run_test.pl @@ -20,14 +20,6 @@ sub add_path { } } -# Set the library path for the client to be able to load -# the common library library. -add_path('LD_LIBRARY_PATH', '../lib'); -add_path('LIBPATH', '../lib'); -add_path('SHLIB_PATH', '../lib'); -add_path('PATH', '../lib'); -add_path('DYLD_LIBRARY_PATH', '../lib'); - $status = 0; $client = PerlACE::LocalFile ("client"); @@ -77,7 +69,7 @@ if (PerlACE::waitforfile_timed ($iorfile, } print STDERR $CL->CommandLine()."\n"; -$client = $CL->SpawnWaitKill (300); +$client = $CL->SpawnWaitKill (60); if ($client != 0) { print STDERR "$0: ERROR: client returned $client\n"; diff --git a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp index 5a84ba9b191..64c78136ada 100644 --- a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp +++ b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.cpp @@ -65,10 +65,10 @@ namespace Test void Client_Request_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri) { - //Test TC + // Test TC test_transport_current ("send_request"); - CORBA::Boolean response_expected = + CORBA::Boolean const response_expected = ri->response_expected (); // Oneway? @@ -87,7 +87,7 @@ namespace Test ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_); ACE_OS::sprintf (temp, "%d", this->requestID_); - this->requestID_++; + ++this->requestID_; } CORBA::ULong string_len = ACE_OS::strlen (temp) + 1; diff --git a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h index 6e9d34ae9b9..148b8075c8e 100644 --- a/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h +++ b/TAO/tests/TransportCurrent/lib/Client_Request_Interceptor.h @@ -78,7 +78,6 @@ namespace Test virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri); - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri); virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri); diff --git a/TAO/tests/TransportCurrent/lib/Current_Test_Lib.mpc b/TAO/tests/TransportCurrent/lib/Current_Test_Lib.mpc index 993ff326393..e2806575743 100644 --- a/TAO/tests/TransportCurrent/lib/Current_Test_Lib.mpc +++ b/TAO/tests/TransportCurrent/lib/Current_Test_Lib.mpc @@ -16,9 +16,8 @@ project(*idl): taoidldefaults { project(*Client): tc { - after += *idl TAO_TC + after += *idl includes += . - libout = . dynamicflags += CURRENT_TEST_BUILD_DLL Source_Files { @@ -36,9 +35,8 @@ project(*Client): tc { project(*Server): tc, pi_server { - after += *Client + after += *idl includes += . - libout = . dynamicflags += CURRENT_TEST_BUILD_DLL Source_Files { diff --git a/TAO/tests/Two_Objects/Second_i.cpp b/TAO/tests/Two_Objects/Second_i.cpp index f7814901d3d..462864406a7 100644 --- a/TAO/tests/Two_Objects/Second_i.cpp +++ b/TAO/tests/Two_Objects/Second_i.cpp @@ -25,7 +25,7 @@ Second_i::Second_i (CORBA::ORB_ptr orb, Two_Objects_Test::Octet_Seq * Second_i::twoway_method (void) { - Two_Objects_Test::Octet_Seq *preply_mesg; + Two_Objects_Test::Octet_Seq *preply_mesg = 0; ACE_NEW_THROW_EX (preply_mesg, Two_Objects_Test::Octet_Seq (this->length_), diff --git a/TAO/tests/Two_Objects/client.cpp b/TAO/tests/Two_Objects/client.cpp index 4d90109d0da..386a4cad980 100644 --- a/TAO/tests/Two_Objects/client.cpp +++ b/TAO/tests/Two_Objects/client.cpp @@ -84,6 +84,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "Client : length of returned data is %d\n", reply_seq->length() )); + second->shutdown (); + orb->destroy (); } catch (const CORBA::Exception& ex) diff --git a/TAO/tests/Two_Objects/run_test.pl b/TAO/tests/Two_Objects/run_test.pl index 2dcc3917a2a..139e4b319c0 100755 --- a/TAO/tests/Two_Objects/run_test.pl +++ b/TAO/tests/Two_Objects/run_test.pl @@ -14,10 +14,10 @@ unlink $iorfile; $status = 0; if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o $baseiorfile -t 10 -l 100000"); + $SV = new PerlACE::ProcessVX ("server", "-o $baseiorfile -l 100000"); } else { - $SV = new PerlACE::Process ("server", "-o $iorfile -t 10 0l 100000"); + $SV = new PerlACE::Process ("server", "-o $iorfile -l 100000"); } $CL = new PerlACE::Process ("client", " -r file://$iorfile"); @@ -37,7 +37,7 @@ if ($client != 0) { $status = 1; } -$server = $SV->WaitKill (60); +$server = $SV->WaitKill (15); if ($server != 0) { print STDERR "ERROR: server returned $server\n"; diff --git a/TAO/tests/Two_Objects/server.cpp b/TAO/tests/Two_Objects/server.cpp index 94be58e476e..3fe5efa1091 100644 --- a/TAO/tests/Two_Objects/server.cpp +++ b/TAO/tests/Two_Objects/server.cpp @@ -10,8 +10,6 @@ ACE_RCSID(Test, server, "$Id$") int msglen = 100; //default length of reply message is 100 bytes int nthreads = 2; const char *ior_output_file = "test.ior"; -int orb_timeout = 30; //default timeout for ORB is 30 sec - int parse_args (int argc, char *argv[]) @@ -34,10 +32,6 @@ parse_args (int argc, char *argv[]) nthreads = ACE_OS::atoi (get_opts.opt_arg ()); break; - case 't': - orb_timeout = ACE_OS::atoi (get_opts.opt_arg ()); - break; - case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -45,7 +39,6 @@ parse_args (int argc, char *argv[]) "-o <iorfile>" " -n <#of threads>" " -l <size of message in bytes>" - " -t <timeout for ORB in secs>" "\n", argv [0]), -1); @@ -85,11 +78,11 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) return 1; ACE_DEBUG(( LM_DEBUG, "ior file = %s\t#threads = %d\t" - "msglen = %d\tORB timeout = %d sec\n", - ior_output_file, nthreads, msglen, orb_timeout )); + "msglen = %d\n", + ior_output_file, nthreads, msglen)); // Create the factory servant - Object_Factory_i *factory_impl; + Object_Factory_i *factory_impl = 0; ACE_NEW_THROW_EX (factory_impl, Object_Factory_i (orb.in (), msglen), CORBA::NO_MEMORY ()); @@ -125,7 +118,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) poa_manager->activate (); // Instantiate the specified # of worker threads - Worker worker (orb.in (), orb_timeout); + Worker worker (orb.in ()); if (worker.activate (THR_NEW_LWP | THR_JOINABLE, nthreads) != 0) diff --git a/TAO/tests/Two_Objects/worker.cpp b/TAO/tests/Two_Objects/worker.cpp index e3de9ceefa2..536534ed518 100644 --- a/TAO/tests/Two_Objects/worker.cpp +++ b/TAO/tests/Two_Objects/worker.cpp @@ -4,9 +4,8 @@ #include "worker.h" -Worker::Worker (CORBA::ORB_ptr orb, int time) - : orb_ (CORBA::ORB::_duplicate (orb)), - orb_timeout_(time) +Worker::Worker (CORBA::ORB_ptr orb) + : orb_ (CORBA::ORB::_duplicate (orb)) { } @@ -16,10 +15,7 @@ Worker::svc (void) try { - ACE_Time_Value tv (orb_timeout_); - - // orb times out after <timeout> seconds - this->orb_->run (tv); + this->orb_->run (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Two_Objects/worker.h b/TAO/tests/Two_Objects/worker.h index 1e2a5a3b54e..5448f00e253 100644 --- a/TAO/tests/Two_Objects/worker.h +++ b/TAO/tests/Two_Objects/worker.h @@ -15,7 +15,7 @@ class Worker : public ACE_Task_Base public: // Ctor - Worker (CORBA::ORB_ptr orb, int time); + Worker (CORBA::ORB_ptr orb); // The thread entry point. virtual int svc (void); @@ -24,8 +24,6 @@ public: private: // The orb CORBA::ORB_var orb_; - - int orb_timeout_; }; #endif /* TAO_TWO_OBJECTS_WORKER_H */ |