From 43e5514fef36e6aa1db5fd67a94446aa48bc1e8e Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Thu, 14 Apr 2005 19:58:14 +0000 Subject: ChangeLogTag:Thu Apr 14 15:25:31 2005 Steve Huston --- ChangeLog | 14 ++++++++++++++ examples/Reactor/WFMO_Reactor/run_test.pl | 1 - tests/Priority_Reactor_Test.cpp | 18 +++++++++++------- tests/Reactor_Notify_Test.cpp | 6 +++--- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f926ba6265..687286a6833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Thu Apr 14 15:25:31 2005 Steve Huston + + * examples/Reactor/WFMO_Reactor/run_test.pl: Removed the "require + Process" line - it tried to refer to the one in $ACE_ROOT/bin, which + was removed: + Mon Apr 4 11:20:08 2005 J.T. Conklin + + * tests/Priority_Reactor_Test.cpp (run_main): + * tests/Reactor_Notify_Test.cpp (run_test): Use the ACE_Reactor's + delete_implementation setting to delete any created reactor + implementation instead of using separate auto_ptr objects for the + ACE_Reactor and its implementation. Prevents destruction + order issues if the implementation is destroyed first. + Thu Apr 14 09:21:14 2005 Chad Elliott * bin/MakeProjectCreator/config/taoidldefaults.mpb: diff --git a/examples/Reactor/WFMO_Reactor/run_test.pl b/examples/Reactor/WFMO_Reactor/run_test.pl index a629bf32b51..cc445c64043 100755 --- a/examples/Reactor/WFMO_Reactor/run_test.pl +++ b/examples/Reactor/WFMO_Reactor/run_test.pl @@ -5,7 +5,6 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -require Process; use lib '../../../bin'; use PerlACE::Run_Test; diff --git a/tests/Priority_Reactor_Test.cpp b/tests/Priority_Reactor_Test.cpp index 62b0c5ae5f4..0f1253c211d 100644 --- a/tests/Priority_Reactor_Test.cpp +++ b/tests/Priority_Reactor_Test.cpp @@ -271,23 +271,24 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_NOTREACHED (break); } - // Manage memory automagically. - // Note: This ordering is very subtle... - auto_ptr reactor; - auto_ptr impl; + // Manage Reactor memory automagically. + // Note: If opt_priority_reactor is false, the default ACE_Reactor is used + // and we don't need to set one up. + ACE_Reactor *orig_reactor = 0; + auto_ptr reactor; if (opt_priority_reactor) { ACE_Select_Reactor *impl_ptr; ACE_NEW_RETURN (impl_ptr, ACE_Priority_Reactor, -1); auto_ptr auto_impl (impl_ptr); - impl = auto_impl; ACE_Reactor *reactor_ptr; - ACE_NEW_RETURN (reactor_ptr, ACE_Reactor (impl_ptr), -1); + ACE_NEW_RETURN (reactor_ptr, ACE_Reactor (impl_ptr, 1), -1); + auto_impl.release (); // ACE_Reactor dtor will take it from here auto_ptr auto_reactor (reactor_ptr); reactor = auto_reactor; - ACE_Reactor::instance (reactor_ptr); + orig_reactor = ACE_Reactor::instance (reactor_ptr); } Read_Handler::set_countdown (opt_nchildren); @@ -387,6 +388,9 @@ run_main (int argc, ACE_TCHAR *argv[]) // We aborted on the previous #ifdef #endif /* ACE_HAS_THREADS */ + if (orig_reactor != 0) + ACE_Reactor::instance (orig_reactor); + ACE_END_TEST; return 0; } diff --git a/tests/Reactor_Notify_Test.cpp b/tests/Reactor_Notify_Test.cpp index 2b2a41790fb..115712ad4b4 100644 --- a/tests/Reactor_Notify_Test.cpp +++ b/tests/Reactor_Notify_Test.cpp @@ -285,15 +285,14 @@ run_test (int disable_notify_pipe, ACE_Reactor *reactor; ACE_NEW_RETURN (reactor, - ACE_Reactor (reactor_impl), + ACE_Reactor (reactor_impl, 1), // Delete implementation -1); // Make sure this stuff gets cleaned up when this function exits. auto_ptr r (reactor); - auto_ptr ri (reactor_impl); // Set the Singleton Reactor. - ACE_Reactor::instance (reactor); + ACE_Reactor *orig_reactor = ACE_Reactor::instance (reactor); ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); ACE_ASSERT (ACE_Reactor::instance () == reactor); @@ -356,6 +355,7 @@ run_test (int disable_notify_pipe, ACE_TEXT ("(%t) releasing supplier task thread\n"))); task.release (); } + ACE_Reactor::instance (orig_reactor); return 0; } -- cgit v1.2.1