diff options
Diffstat (limited to 'TAO/tao/Strategies/advanced_resource.cpp')
-rw-r--r-- | TAO/tao/Strategies/advanced_resource.cpp | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/TAO/tao/Strategies/advanced_resource.cpp b/TAO/tao/Strategies/advanced_resource.cpp index dc6c0a5886f..62c42275c06 100644 --- a/TAO/tao/Strategies/advanced_resource.cpp +++ b/TAO/tao/Strategies/advanced_resource.cpp @@ -1,17 +1,17 @@ // $Id$ #include "ace/Service_Config.h" -#include "tao/Strategies/advanced_resource.h" +#include "advanced_resource.h" -#include "tao/Strategies/UIOP_Factory.h" -#include "tao/Strategies/SHMIOP_Factory.h" -#include "tao/Strategies/DIOP_Factory.h" -#include "tao/Strategies/SCIOP_Factory.h" +#include "UIOP_Factory.h" +#include "SHMIOP_Factory.h" +#include "DIOP_Factory.h" +#include "SCIOP_Factory.h" -#include "tao/Strategies/LFU_Connection_Purging_Strategy.h" -#include "tao/Strategies/FIFO_Connection_Purging_Strategy.h" -#include "tao/Strategies/NULL_Connection_Purging_Strategy.h" +#include "LFU_Connection_Purging_Strategy.h" +#include "FIFO_Connection_Purging_Strategy.h" +#include "NULL_Connection_Purging_Strategy.h" -#include "tao/Strategies/LF_Strategy_Null.h" +#include "LF_Strategy_Null.h" #include "tao/debug.h" #include "tao/LRU_Connection_Purging_Strategy.h" @@ -37,8 +37,6 @@ ACE_RCSID(Strategies, advanced_resource, "$Id$") -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - TAO_Resource_Factory_Changer::TAO_Resource_Factory_Changer (void) { @@ -130,7 +128,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) -1); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBReactorLock")))) { ACE_DEBUG ((LM_DEBUG, @@ -144,7 +142,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) arg_shifter.consume_arg (); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBReactorType")))) { if (ACE_OS::strcasecmp (current_arg, @@ -186,7 +184,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) arg_shifter.consume_arg (); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBInputCDRAllocator")))) { if (ACE_OS::strcasecmp (current_arg, @@ -208,7 +206,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) arg_shifter.consume_arg (); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBAMHResponseHandlerAllocator")))) { if (ACE_OS::strcasecmp (current_arg, @@ -228,7 +226,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) arg_shifter.consume_arg (); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBAMIResponseHandlerAllocator")))) { if (ACE_OS::strcasecmp (current_arg, @@ -248,7 +246,7 @@ TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv) arg_shifter.consume_arg (); } - else if (0 != (current_arg = arg_shifter.get_the_parameter + else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBReactorThreadQueue")))) { if (ACE_OS::strcasecmp (current_arg, @@ -384,7 +382,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) ACE_ERROR ((LM_ERROR, ACE_TEXT("TAO (%P|%t) Unable to add ") ACE_TEXT("<%s> to protocol factory set.\n"), - ACE_TEXT_CHAR_TO_TCHAR(item->protocol_name ().c_str ()))); + ACE_TEXT_TO_TCHAR_IN(item->protocol_name ().c_str ()))); delete item; @@ -447,7 +445,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) ACE_ERROR ((LM_ERROR, ACE_TEXT("TAO (%P|%t) Unable to add ") ACE_TEXT("<%s> to protocol factory set.\n"), - ACE_TEXT_CHAR_TO_TCHAR(item->protocol_name ().c_str ()))); + ACE_TEXT_TO_TCHAR_IN(item->protocol_name ().c_str ()))); delete item; @@ -510,7 +508,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) ACE_ERROR ((LM_ERROR, ACE_TEXT("TAO (%P|%t) Unable to add ") ACE_TEXT("<%s> to protocol factory set.\n"), - ACE_TEXT_CHAR_TO_TCHAR(item->protocol_name ().c_str ()))); + ACE_TEXT_TO_TCHAR_IN(item->protocol_name ().c_str ()))); delete item; @@ -573,7 +571,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) ACE_ERROR ((LM_ERROR, ACE_TEXT("TAO (%P|%t) Unable to add ") ACE_TEXT("<%s> to protocol factory set.\n"), - ACE_TEXT_CHAR_TO_TCHAR(item->protocol_name ().c_str ()))); + ACE_TEXT_TO_TCHAR_IN(item->protocol_name ().c_str ()))); delete item; @@ -606,7 +604,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("TAO (%P|%t) Unable to load ") ACE_TEXT("protocol <%s>, %m\n"), - ACE_TEXT_CHAR_TO_TCHAR(name.c_str ())), + ACE_TEXT_TO_TCHAR_IN(name.c_str ())), -1); } @@ -614,7 +612,7 @@ TAO_Advanced_Resource_Factory::init_protocol_factories (void) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT("TAO (%P|%t) Loaded protocol <%s>\n"), - ACE_TEXT_CHAR_TO_TCHAR(name.c_str ()))); + ACE_TEXT_TO_TCHAR_IN(name.c_str ()))); } } return 0; @@ -691,6 +689,9 @@ TAO_Advanced_Resource_Factory::allocate_reactor_impl (void) const typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,ACE_Null_Mutex> NULL_LOCK_MALLOC; typedef ACE_Allocator_Adapter<NULL_LOCK_MALLOC> NULL_LOCK_ALLOCATOR; +typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,TAO_SYNCH_MUTEX> LOCKED_MALLOC; +typedef ACE_Allocator_Adapter<LOCKED_MALLOC> LOCKED_ALLOCATOR; + ACE_Allocator * TAO_Advanced_Resource_Factory::input_cdr_dblock_allocator (void) { @@ -721,9 +722,12 @@ TAO_Advanced_Resource_Factory::input_cdr_buffer_allocator (void) NULL_LOCK_ALLOCATOR, 0); break; + case TAO_ALLOCATOR_THREAD_LOCK: default: - return - this->TAO_Default_Resource_Factory::input_cdr_buffer_allocator(); + ACE_NEW_RETURN (allocator, + LOCKED_ALLOCATOR, + 0); + break; } return allocator; } @@ -874,8 +878,6 @@ TAO_Advanced_Resource_Factory::report_unsupported_error ( option_name)); } -TAO_END_VERSIONED_NAMESPACE_DECL - // **************************************************************** ACE_STATIC_SVC_DEFINE (TAO_Advanced_Resource_Factory, |