diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-16 17:57:35 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-16 17:57:35 +0000 |
commit | 20ed9d12258ba5250f0bd27c374a1836ec9678cc (patch) | |
tree | c38dbd5e8836b7f1cc210a61c5228e8b9fd587ed | |
parent | 6e3819d1ab25897551c493f7481007f4b7e8dabc (diff) | |
download | ATCD-20ed9d12258ba5250f0bd27c374a1836ec9678cc.tar.gz |
ChangeLogTag: Wed Apr 16 13:44:47 2003 Irfan Pyarali <irfan@oomworks.com>
136 files changed, 4686 insertions, 1708 deletions
diff --git a/ChangeLog b/ChangeLog index d25b2a92c0f..12e845d84ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Wed Apr 16 12:15:04 2003 Irfan Pyarali <irfan@oomworks.com> + + * ace\OS: + + - thr_setprio(): Streamlined code to only call + pthread_getschedparam() when <policy> is -1. + + - thr_getprio(): Added a new function so that the user can + retrieve scheduling policy information in addition to the + priority of a thread. This makes the thr_getprio() function + consistent with the changes to thr_setprio(). + + * ace\Thread: Made changes to the thr_setprio() and thr_getprio() + functions to make them similar to the ACE_OS functions. + Wed Apr 16 11:34:49 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * bin/auto_run_tests.pl: Fixed a typo. diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 8d632315036..45e2589d606 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,319 @@ +Wed Apr 16 13:44:47 2003 Irfan Pyarali <irfan@oomworks.com> + + * tao\params: + + - thread_creation_flags: Added a new function that OR's together + the scheduling scope and scheduling policy thread creation + flags. + + - ace_sched_policy: Added a new function to return the + ACE_SCHED_* flag. The sched_policy() returns the THR_SCHED_* + thread creation flag, the scope_policy() returns the THR_SCOPE_* + thread creation flag, and the ace_sched_policy() returns the + ACE_SCHED_* flag. + + * tao\RTCORBA\RT_ORB.cpp (modify_thread_scheduling_policy): Added + new static method that changes the scheduling policy of the + calling thread to match the scheduling policy specified in the + svc.conf file. The priority of the calling thread will be set + to the minimum priority supported by that scheduling policy. + + This method make sense on those platform (e.g., Linux) where + PTHREAD_SCOPE_SYSTEM is the only scheduling scope supported. On + other platforms, this method is a no-op since the only way to + get the real-time threading behavior is to setup the + PTHREAD_SCOPE_SYSTEM scheduling scope when a thread is being + created. On such platforms, one can set the correct scheduling + scope and policy when creating the thread, thus not needing to + use this method. + + * tao\RTCORBA\RT_ORBInitializer.cpp (TAO_RT_ORBInitializer): Undid + changes from: + + Wed Feb 12 00:19:58 UTC 2003 Craig Rodrigues <crodrigu@bbn.com> + + - Since there is a new variable <ace_sched_policy_>, no + conversions between is required between THR_SCHED_* and + ACE_SCHED_*. + + - There is no longer a need to "automagically" change the + scheduling policy of the thread calling + TAO_RT_ORBInitializer::pre_init(), specially given the fact that + the scheduling scope of a thread cannot be changed after it has + been created, and without the scheduling scope being set + appropriately, real-time threading behavior is not possible. + + To achieve the similar behavior as before on platforms like + Linux that only support the PTHREAD_SCOPE_SYSTEM scheduling + scope, please call the + TAO_RT_ORB::modify_thread_scheduling_policy() static method. + + * tao\RTCORBA\Thread_Pool.cpp (create_dynamic_threads): + + Changed code to use the new canonical thread_creation_flags() + routine. + + * tao\RTCORBA\Thread_Pool.cpp: + * tao\Exception.cpp: + * tao\corbafwd.h: + + Added TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE so that failures + in thread creation for RTCORBA thread pools can be easily + identified. + +Wed Apr 16 12:15:04 2003 Irfan Pyarali <irfan@oomworks.com> + + * tests\RTCORBA\Destroy_Thread_Pool\Destroy_Thread_Pool.cpp: + * tests\RTCORBA\Explicit_Binding\client.cpp: + * tests\RTCORBA\Explicit_Binding\server.cpp: + * tests\RTCORBA\ORB_init\ORB_init.cpp: + * tests\RTCORBA\Persistent_IOR\client.cpp: + * tests\RTCORBA\Persistent_IOR\server.cpp: + * tests\RTCORBA\Private_Connection\client.cpp: + * tests\RTCORBA\Private_Connection\server.cpp: + * tests\RTCORBA\RTMutex\server.cpp: + * tests\RTCORBA\Server_Declared\client.cpp: + * tests\RTCORBA\Server_Declared\server.cpp: + * tests\RTCORBA\Server_Protocol\client.cpp: + * tests\RTCORBA\Server_Protocol\server.cpp: + * tests\RTCORBA\Thread_Pool\client.cpp: + + Check for multiple priorities is not needed for this test since + multiple priorities are not used in this test. + + * tests\RTCORBA\Banded_Connections\client.cpp: + * tests\RTCORBA\Client_Protocol\client.cpp: + * tests\RTCORBA\Collocation\Collocation.cpp: + * tests\RTCORBA\Linear_Priority\client.cpp: + * tests\RTCORBA\MT_Client_Protocol_Priority\client.cpp: + * tests\RTCORBA\Policy_Combinations\client.cpp: + * tests\RTCORBA\Profile_And_Endpoint_Selection\client.cpp: + * tests\RTCORBA\Thread_Pool\client.cpp: + * performance-tests\RTCorba\Thread_Pool\client.cpp: + + Make all real-time invocations and priority changes from a + real-time thread rather than the main thread. This will allow + the test to work on platforms like Linux with root as the user + (and the appropriate svc.conf settings). + + * tests\RTCORBA\Client_Propagated\server.cpp: + * tests\RTCORBA\Linear_Priority/server.cpp: + * tests\RTCORBA\MT_Client_Protocol_Priority/server.cpp: + * tests\RTCORBA\Policy_Combinations/server.cpp: + * tests\RTCORBA\Profile_And_Endpoint_Selection/server.cpp: + * tests\RTCORBA\Server_Declared/server.cpp: + * tests\RTCORBA\Thread_Pool/server.cpp: + + Handle all real-time upcall in a real-time thread rather than + the main thread. This will allow the test to work on platforms + like Linux with root as the user (and the appropriate svc.conf + settings). + + * tests\RTCORBA\Banded_Connections\svc.conf: + * tests\RTCORBA\Client_Propagated\svc.conf: + * tests\RTCORBA\Client_Protocol\svc.conf: + * tests\RTCORBA\Explicit_Binding\svc.conf: + * tests\RTCORBA\Linear_Priority\svc.conf: + * tests\RTCORBA\MT_Client_Protocol_Priority\server.conf: + * tests\RTCORBA\MT_Client_Protocol_Priority\client.conf: + * tests\RTCORBA\Policy_Combinations\svc.conf: + * tests\RTCORBA\Profile_And_Endpoint_Selection\svc.conf: + * tests\RTCORBA\Server_Declared\svc.conf: + * tests\RTCORBA\Server_Protocol\server_iiop.conf: + * tests\RTCORBA\Server_Protocol\server_reverse.conf: + * tests\RTCORBA\Server_Protocol\server_reverse_nt.conf: + * tests\RTCORBA\Server_Protocol\server_shmiop.conf: + * tests\RTCORBA\Server_Protocol\server_uiop.conf: + * tests\RTCORBA\Thread_Pool\svc.conf: + + Updated config file to remove SCHED_FIFO as the scheduling + policy for normal, non-RT testing. + + * tests\RTCORBA\Banded_Connections\svc.conf.xml: + * tests\RTCORBA\Client_Propagated\svc.conf.xml: + * tests\RTCORBA\Collocation\svc.conf.xml: + * tests\RTCORBA\MT_Client_Protocol_Priority\svc.conf.xml: + * tests\RTCORBA\Server_Declared\svc.conf.xml: + * tests\RTCORBA\Thread_Pool\svc.conf.xml: + + Added missing file. + + * tests\RTCORBA\Banded_Connections\server.conf: + * tests\RTCORBA\Banded_Connections\server.conf.xml: + * tests\RTCORBA\Destroy_Thread_Pool\svc.conf: + * tests\RTCORBA\MT_Client_Protocol_Priority\server.conf: + * tests\RTCORBA\MT_Client_Protocol_Priority\client.conf: + * tests\RTCORBA\ORB_init\svc.conf: + * tests\RTCORBA\Persistent_IOR\svc.conf: + * tests\RTCORBA\Policies\svc.conf: + * tests\RTCORBA\Private_Connection\svc.conf: + * tests\RTCORBA\RTMutex\svc.conf: + * tests\RTCORBA\Server_Declared\server.conf: + * tests\RTCORBA\Server_Declared\server.conf.xml: + * tests\RTCORBA\Server_Protocol\svc.conf: + * performance-tests\RTCorba\Thread_Pool\fudge_priorities.cpp: + + These files are no longer used. + + * tests\RTCORBA\Banded_Connections\server.cpp: + * tests\RTCORBA\Client_Propagated\client.cpp: + * tests\RTCORBA\Client_Propagated\server.cpp: + * tests\RTCORBA\Client_Protocol\client.cpp: + * tests\RTCORBA\Client_Protocol\server.cpp: + * tests\RTCORBA\Destroy_Thread_Pool\Destroy_Thread_Pool.cpp: + * tests\RTCORBA\Diffserv\server.cpp: + * tests\RTCORBA\Diffserv\client.cpp: + * tests\RTCORBA\Explicit_Binding\client.cpp: + * tests\RTCORBA\Explicit_Binding\server.cpp: + * tests\RTCORBA\MT_Client_Protocol_Priority\client.cpp: + * tests\RTCORBA\MT_Client_Protocol_Priority\server.cpp: + * tests\RTCORBA\Private_Connection\client.cpp: + * tests\RTCORBA\Private_Connection\server.cpp: + * tests\RTCORBA\RTMutex\server.cpp: + * tests\RTCORBA\Server_Declared\client.cpp: + * tests\RTCORBA\Server_Declared\server.cpp: + * tests\RTCORBA\Server_Protocol\client.cpp: + * tests\RTCORBA\Server_Protocol\server.cpp: + * tests\RTCORBA\Thread_Pool\client.cpp: + * tests\RTCORBA\Thread_Pool\server.cpp: + + Errors should be indicated with a return value -1 and not 1. + + * tests\RTCORBA\Banded_Connections\run_test.pl: + * tests\RTCORBA\Client_Propagated\run_test.pl: + * tests\RTCORBA\Collocation\run_test.pl: + * tests\RTCORBA\Linear_Priority\run_test.pl: + * tests\RTCORBA\MT_Client_Protocol_Priority\run_test.pl: + * tests\RTCORBA\Policy_Combinations\run_test.pl: + * tests\RTCORBA\Profile_And_Endpoint_Selection\run_test.pl: + * tests\RTCORBA\Server_Declared\run_test.pl: + * tests\RTCORBA\Thread_Pool\run_test.pl: + + Removed incorrect error message. + + * tests\RTCORBA\MT_Client_Protocol_Priority\client.cpp: + * tests\RTCORBA\Profile_And_Endpoint_Selection\client.cpp: + * examples\RTCORBA\Activity\Activity.cpp: + * orbsvcs\orbsvcs\Notify\CosNotify_Service.cpp: + + Use thread_creation_flags() to create invocation threads. + + * tests\RTCORBA\Policy_Combinations\server.cpp: + + Fixed the use of calling sched_policy() to calling + ace_sched_policy(). + + * tests\RTCORBA\MT_Client_Protocol_Priority\svc.conf: + * tests\RTCORBA\MT_Client_Protocol_Priority\run_test.pl: + + No need for separate client.conf and server.conf files. Options + can be combined into one svc.conf file. + + * tests\RTCORBA\Linear_Priority\client.cpp: + * tests\RTCORBA\Profile_And_Endpoint_Selection\client.cpp: + + Gave the Worker_Threads a stack based instance of the + Thread_Manager rather than using the singleton instance. + + * tests\RTCORBA\Client_Propagated\client.cpp: + + Don't fix the scheduling policy value - use ace_sched_policy() + to get the scheduling policy in use. + + * tests\RTCORBA\check_supported_priorities.cpp: + + - check_supported_priorities(): No need for conversions - simply + use the new ace_sched_policy(). + + - sched_policy_name(): Added a helper routine to help convert + scheduling policy constants into strings. + + * tests\RTCORBA\Server_Declared\run_test.pl: + * tests\RTCORBA\MT_Client_Protocol_Priority\run_test.pl: + + Fixed the priority values for Solaris since they were not in the + SCHED_FIFO range for Solaris 5.7. + + * performance-tests\RTCorba\Thread_Pool\client.cpp: + + - Removed the <continuous_workers_are_rt> options since all + threads have to be of the same scope to get the mapping correct. + + - No need to call fudge_priorities() since the main thread no + longer makes real-time invocations. + + * examples\RTCORBA\Activity\Activity.cpp: + + - No need to store <scope_policy> since it is available from ORB + params. + + - init_sched() is not needed and was removed. + + - Simplified call to activate(). + + * orbsvcs\orbsvcs\Notify\CosNotify_Service.cpp: + + - init_main_thread() was removed since it was not needed or + used. + + - Removed <scope_policy> and <sched_policy> since these are + available from ORB params. + + * $ACE_ROOT/bin/tao_orb_tests.lst: + + - All RTCORBA tests should now run on Linux. If there are + insuffient number of priorities in the scheduling policy + selected, the test should exit gracefully. + + - Fixed the !ST settings. Server_Protocol, Private_Connection, + ORB_init, Explicit_Binding, and Client_Protocol should work with + the single threaded configuration. + +Wed Apr 16 12:15:04 2003 Irfan Pyarali <irfan@oomworks.com> + + * tao\PortableServer\Object_Adapter (Non_Servant_Upcall): + + Nested non-servant upcalls were not being handling correctly. + Added <non_servant_upcall_nesting_level_> that counts the current + nesting level. Also added a <previous_> pointer so that + Non_Servant_Upcall instances can be chained. + + Thanks to Weston Markham <wmarkham@tissueinformatics.com> for + pointing this out. This fixes bug #1432. + + * tests\POA\Nested_Non_Servant_Upcalls: + + New test to ensure that nested non-servant upcalls are handled + correctly. + + The following files were added: + + - Makefile + - Nested_Non_Servant_Upcalls.cpp + - Nested_Non_Servant_Upcalls.dsp + - Nested_Non_Servant_Upcalls.dsw + - Nested_Non_Servant_Upcalls.mpc + - makefile.bor + - run_test.pl + - test.idl + + The following files were modified: + + - $ACE_ROOT/THANKS + - $ACE_ROOT/bin/tao_orb_tests.lst + - tests/TAO_Tests.dsw + - tests/POA/Makefile + - tests/POA/Makefile.bor + - tests/POA/README + +Wed Apr 16 12:15:04 2003 Irfan Pyarali <irfan@oomworks.com> + + * tao\PortableServer\POA.h (server_protocol): + + Made this method virtual so that the correct derived real-time + method gets invoked. Thanks to Craig Rodrigues + <crodrigu@bbn.com> for pointing this out. This fixes bug 1466. + Wed Apr 16 08:27:21 2003 Ossama Othman <ossama@uci.edu> * tao/CORBA_String.cpp: diff --git a/TAO/examples/RTCORBA/Activity/Activity.cpp b/TAO/examples/RTCORBA/Activity/Activity.cpp index 57d35522099..c588655bd47 100644 --- a/TAO/examples/RTCORBA/Activity/Activity.cpp +++ b/TAO/examples/RTCORBA/Activity/Activity.cpp @@ -50,18 +50,6 @@ Activity::orb (void) return orb_.in (); } -long -Activity::scope_policy (void) -{ - return thr_scope_policy_; -} - -long -Activity::sched_policy (void) -{ - return thr_sched_policy_; -} - RTCORBA::Current_ptr Activity::current (void) { @@ -81,8 +69,6 @@ Activity::init (int& argc, char *argv [] ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); - this->init_sched (); - CORBA::Object_var object = orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); @@ -99,7 +85,7 @@ Activity::init (int& argc, char *argv [] object = orb_->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); this->rt_orb_ = @@ -255,7 +241,7 @@ Activity::activate_schedule (ACE_ENV_SINGLE_ARG_DECL) name[0].id = CORBA::string_dup (task->job ()); CORBA::Object_var obj = - this->naming_->resolve (name ACE_ENV_ARG_PARAMETER); + this->naming_->resolve (name ACE_ENV_ARG_PARAMETER); ACE_CHECK; Job_var job = Job::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); @@ -321,18 +307,18 @@ void Activity::job_ended (Job_i* /*ended_job*/) { ACE_DEBUG ((LM_DEBUG, "Active job count = %d\n",active_job_count_)); - { - ACE_GUARD (ACE_Lock, ace_mon, *state_lock_); - --active_job_count_; + { + ACE_GUARD (ACE_Lock, ace_mon, *state_lock_); + --active_job_count_; } - this->check_ifexit (); + this->check_ifexit (); } void Activity::check_ifexit (void) { - // All tasks have finished and all jobs have been shutdown. + // All tasks have finished and all jobs have been shutdown. if (active_task_count_ == 0 && active_job_count_ == 0) { ACE_DEBUG ((LM_DEBUG, "Shutdown in progress ...\n")); @@ -380,69 +366,6 @@ Activity::get_server_priority (CORBA::Object_ptr server return priority_policy->server_priority (ACE_ENV_SINGLE_ARG_PARAMETER); } -int -Activity::init_sched (void) -{ - thr_sched_policy_ = orb_->orb_core ()->orb_params ()->sched_policy (); - thr_scope_policy_ = orb_->orb_core ()->orb_params ()->scope_policy (); - - if (thr_sched_policy_ == THR_SCHED_FIFO) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_FIFO\n")); - - sched_policy_ = ACE_SCHED_FIFO; - } - else if (thr_sched_policy_ == THR_SCHED_RR) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_RR\n")); - - sched_policy_ = ACE_SCHED_RR; - } - else - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_OTHER\n")); - - sched_policy_ = ACE_SCHED_OTHER; - } - - int min_priority = ACE_Sched_Params::priority_min (sched_policy_); - int max_priority = ACE_Sched_Params::priority_max (sched_policy_); - - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, "max_priority = %d, min_priority = %d\n", - max_priority, min_priority)); - - if (max_priority == min_priority) - { - ACE_DEBUG ((LM_DEBUG,"Detected max_priority == min_priority\n")); - } - } - - // Set the main thread to min priority... - int priority = min_priority; - - if (ACE_OS::sched_params (ACE_Sched_Params (sched_policy_, - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t): sched_params failed\n"),-1); - } - - return 0; -} - void Activity::run (int argc, char *argv[] ACE_ENV_ARG_DECL) { @@ -450,7 +373,7 @@ Activity::run (int argc, char *argv[] ACE_ENV_ARG_DECL) ACE_CHECK; if (this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER) == -1) - return; + return; ACE_CHECK; this->activate_poa_list (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -464,7 +387,6 @@ Activity::run (int argc, char *argv[] ACE_ENV_ARG_DECL) this->create_started_flag_file (argc, argv); - orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; diff --git a/TAO/examples/RTCORBA/Activity/Activity.h b/TAO/examples/RTCORBA/Activity/Activity.h index 6960cdc8d45..b708cd70d77 100644 --- a/TAO/examples/RTCORBA/Activity/Activity.h +++ b/TAO/examples/RTCORBA/Activity/Activity.h @@ -57,8 +57,6 @@ public: /// = Accessors CORBA::ORB_ptr orb (void); RTCORBA::Current_ptr current (void); - long scope_policy (void); - long sched_policy (void); void builder (Builder* builder); /// Returns priority if server declared model else -1 @@ -72,9 +70,6 @@ public: void job_ended (Job_i* ended_job); protected: - /// Init sched mode. - int init_sched (void); - /// = Activation methods. /// Activate the POA's void activate_poa_list (ACE_ENV_SINGLE_ARG_DECL); @@ -97,11 +92,6 @@ public: /// The Builder object. Builder* builder_; - /// = Policies - long thr_sched_policy_; - long thr_scope_policy_; - ACE_Sched_Params::Policy sched_policy_; - /// ACE_Barrier to synch. tasks. ACE_Barrier* barrier_; diff --git a/TAO/examples/RTCORBA/Activity/Thread_Task.cpp b/TAO/examples/RTCORBA/Activity/Thread_Task.cpp index ec5c23f3c4f..f08a8209a5d 100644 --- a/TAO/examples/RTCORBA/Activity/Thread_Task.cpp +++ b/TAO/examples/RTCORBA/Activity/Thread_Task.cpp @@ -3,6 +3,7 @@ #include "ace/High_Res_Timer.h" #include "tao/debug.h" +#include "tao/ORB_Core.h" #include "Activity.h" #include "Task_Stats.h" @@ -25,29 +26,28 @@ Thread_Task::activate_task (ACE_Barrier* barrier, RTCORBA::PriorityMapping *prio this->task_priority_), -1); - long flags = THR_NEW_LWP | THR_JOINABLE; - - flags |= - ACTIVITY::instance()->scope_policy () | - ACTIVITY::instance()->sched_policy (); + long flags = + THR_NEW_LWP | + THR_JOINABLE | + ACTIVITY::instance()->orb ()->orb_core ()->orb_params ()->thread_creation_flags (); // Become an active object. - if (this->ACE_Task <ACE_SYNCH>::activate (flags, - 1, - 0, - native_priority) == -1) - { - if (ACE_OS::last_error () == EPERM) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Insufficient privilege to run this test.\n")), - -1); - else - ACE_DEBUG ((LM_ERROR, - ACE_TEXT ("(%t) task activation at priority %d failed, ") - ACE_TEXT ("exiting!\n%a"), - native_priority, - -1)); - } + if (this->activate (flags, + 1, + 0, + native_priority) == -1) + { + if (ACE_OS::last_error () == EPERM) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Insufficient privilege to run this test.\n")), + -1); + else + ACE_DEBUG ((LM_ERROR, + ACE_TEXT ("(%t) task activation at priority %d failed, ") + ACE_TEXT ("exiting!\n%a"), + native_priority, + -1)); + } return 0; } @@ -120,7 +120,7 @@ Thread_Task::svc (void) elapsed_microseconds*=1000; // convert to uSec on Win32 #endif /* ACE_WIN32 */ - // did we miss any deadlines? + // did we miss any deadlines? int missed = elapsed_microseconds > period_ ? elapsed_microseconds/period_ : 0; diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp index 43c8677ffc0..1e0a7cccacd 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp @@ -91,7 +91,7 @@ TAO_CosNotify_Service::init (int argc, char *argv[]) properties->asynch_updates (1); } - else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0) + else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0) { task_per_proxy = 1; arg_shifter.consume_arg (); @@ -170,10 +170,6 @@ TAO_CosNotify_Service::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) void TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) { - /// first, init the main thread. - //this->init_main_thread (orb ACE_ENV_ARG_PARAMETER); - //ACE_CHECK; - // Obtain the Root POA CORBA::Object_var object = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); @@ -181,89 +177,23 @@ TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) if (CORBA::is_nil (object.in ())) ACE_ERROR ((LM_ERROR, - " (%P|%t) Unable to resolve the RootPOA.\n")); + " (%P|%t) Unable to resolve the RootPOA.\n")); PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; /// Set the properties - TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance(); - - properties->orb (orb); - properties->default_poa (default_poa.in ()); - properties->sched_policy (orb->orb_core ()->orb_params ()->sched_policy ()); - properties->scope_policy (orb->orb_core ()->orb_params ()->scope_policy ()); - - // Init the factory - this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_CosNotify_Service::init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_NOT_USED) -{ - ACE_Sched_Params::Policy sched_policy; - long thr_sched_policy = orb->orb_core ()->orb_params ()->sched_policy (); - - //long thr_scope_policy = orb->orb_core ()->orb_params ()->scope_policy (); - - if (thr_sched_policy == THR_SCHED_FIFO) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_FIFO\n")); - - sched_policy = ACE_SCHED_FIFO; - } - else if (thr_sched_policy == THR_SCHED_RR) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_RR\n")); - - sched_policy = ACE_SCHED_RR; - } - else - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_OTHER\n")); - - sched_policy = ACE_SCHED_OTHER; - } + TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance(); - /// Check sched. - int min_priority = ACE_Sched_Params::priority_min (sched_policy); - int max_priority = ACE_Sched_Params::priority_max (sched_policy); + properties->orb (orb); + properties->default_poa (default_poa.in ()); - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, "max_priority = %d, min_priority = %d\n", - max_priority, min_priority)); + // Init the factory + this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; - if (max_priority == min_priority) - { - ACE_DEBUG ((LM_DEBUG,"Detected max_priority == min_priority\n")); - } - } - - // Set the main thread to min priority... - int priority = min_priority; - - if (ACE_OS::sched_params (ACE_Sched_Params (sched_policy , - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "(%P|%t): sched_params failed\n")); - } + this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h index afbd64a3bf9..6a00ade8b66 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h @@ -64,9 +64,6 @@ protected: /// Create the Builder for Notify objects. virtual void init_builder (ACE_ENV_SINGLE_ARG_DECL); - /// Apply ORB Scheduling policy to main thread and set its priority to the lowest available. - void init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL); - /// Set thread options on <qos>. void set_threads (CosNotification::QoSProperties &qos, int threads); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp index dd4a581afd9..f8faf3ac96d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp @@ -13,8 +13,6 @@ ACE_RCSID (Notify, TAO_NS_Properties, "$Id$") TAO_NS_Properties::TAO_NS_Properties (void) : factory_ (0) , builder_ (0) - , thr_sched_policy_ (THR_SCHED_DEFAULT) - , thr_scope_policy_ (THR_SCOPE_PROCESS) , asynch_updates_ (0) { // In case no conf. file is specified, the EC will default to reactive concurrency. diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.h b/TAO/orbsvcs/orbsvcs/Notify/Properties.h index 4a0a6a03ffc..5eb3d1a6e2e 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Properties.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.h @@ -57,12 +57,6 @@ public: PortableServer::POA_ptr default_poa (void); void default_poa (PortableServer::POA_ptr default_poa); - long scope_policy (void); - void scope_policy (long scope_policy); - - long sched_policy (void); - void sched_policy (long sched_policy); - CORBA::Boolean asynch_updates (void); void asynch_updates (CORBA::Boolean asynch_updates); @@ -109,12 +103,6 @@ protected: // POA PortableServer::POA_var default_poa_; - /// Sched policy - long thr_sched_policy_; - - /// Scope policy - long thr_scope_policy_; - /// True if send asynch updates. CORBA::Boolean asynch_updates_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp index b914c72df2d..2bbd7dd80cf 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp @@ -51,9 +51,11 @@ TAO_NS_ThreadPool_Task::init (const NotifyExt::ThreadPoolParams& tp_params, TAO_ long flags = THR_NEW_LWP | THR_JOINABLE; + CORBA::ORB_var orb = + TAO_NS_PROPERTIES::instance()->orb (); + flags |= - TAO_NS_PROPERTIES::instance()->scope_policy () | - TAO_NS_PROPERTIES::instance()->sched_policy (); + orb->orb_core ()->orb_params ()->thread_creation_flags (); // Increment the count on this object by the number of threads using it. { diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp index cc545f9a8df..3054d4bb804 100644 --- a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp +++ b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp @@ -12,7 +12,7 @@ #include "tao/RTCORBA/Priority_Mapping_Manager.h" #include "testC.h" #include "tests/RTCORBA/common_args.cpp" -#include "fudge_priorities.cpp" +#include "tests/RTCORBA/check_supported_priorities.cpp" ACE_RCSID(Thread_Pool, client, "$Id$") @@ -38,7 +38,6 @@ static int set_priority = 1; static Priority_Setting priority_setting = AFTER_THREAD_CREATION; static int individual_continuous_worker_stats = 0; static int print_missed_invocations = 0; -static int continuous_workers_are_rt = 1; static ACE_hrtime_t test_start; static CORBA::ULong prime_number = 9619; static int count_missed_end_deadlines = 0; @@ -63,7 +62,7 @@ int parse_args (int argc, char *argv[]) { ACE_Get_Opt get_opts (argc, argv, - "c:e:g:hi:j:k:m:p:q:r:t:u:v:w:x:y:z:" //client options + "c:e:g:hi:k:m:p:q:r:t:u:v:w:x:y:z:" //client options "b:f:hl:n:o:s:" // server options ); int c; @@ -91,11 +90,6 @@ parse_args (int argc, char *argv[]) ACE_OS::atoi (get_opts.opt_arg ()); break; - case 'j': - continuous_workers_are_rt = - ACE_OS::atoi (get_opts.opt_arg ()); - break; - case 'k': ior = get_opts.opt_arg (); @@ -175,7 +169,6 @@ parse_args (int argc, char *argv[]) "\t-g <show history> (defaults to %d)\n" "\t-h <help: shows options menu>\n" "\t-i <print stats of individual continuous workers> (defaults to %d)\n" - "\t-j <continuous workers have real time scope and scheduling policies> (defaults to %d)\n" "\t-k <ior> (defaults to %s)\n" "\t-m <print missed invocations for paced workers> (defaults to %d)\n" "\t-p <invocation priorities file> (defaults to %s)\n" @@ -194,7 +187,6 @@ parse_args (int argc, char *argv[]) count_missed_end_deadlines, do_dump_history, individual_continuous_worker_stats, - continuous_workers_are_rt, ior, print_missed_invocations, invocation_priorities_file, @@ -901,8 +893,28 @@ Continuous_Worker::svc (void) return 0; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char *argv[]) +Task::svc (void) { Synchronizers synchronizers; @@ -910,19 +922,8 @@ main (int argc, char *argv[]) ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - int result = - parse_args (argc, argv); - if (result != 0) - return result; - - fudge_priorities (orb.in ()); - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; test_var test = @@ -930,8 +931,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -940,8 +941,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("PriorityMappingManager" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("PriorityMappingManager" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::PriorityMappingManager_var mapping_manager = @@ -953,7 +954,7 @@ main (int argc, char *argv[]) *mapping_manager->mapping (); ULong_Array rates; - result = + int result = get_values ("client", rates_file, "rates", @@ -1036,12 +1037,8 @@ main (int argc, char *argv[]) synchronizers); long flags = THR_NEW_LWP | - THR_JOINABLE; - - if (continuous_workers_are_rt) - flags |= - orb->orb_core ()->orb_params ()->scope_policy () | - orb->orb_core ()->orb_params ()->sched_policy (); + THR_JOINABLE | + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); CORBA::Short CORBA_priority = continuous_worker_priority; @@ -1083,8 +1080,7 @@ main (int argc, char *argv[]) flags = THR_NEW_LWP | THR_JOINABLE | - orb->orb_core ()->orb_params ()->scope_policy () | - orb->orb_core ()->orb_params ()->sched_policy (); + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); for (i = 0; i < rates.size (); @@ -1162,6 +1158,59 @@ main (int argc, char *argv[]) return 0; } +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + ACE_ASSERT (result != -1); + ACE_UNUSED_ARG (result); + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Exception caught:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Array_Base<CORBA::ULong>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/fudge_priorities.cpp b/TAO/performance-tests/RTCorba/Thread_Pool/fudge_priorities.cpp deleted file mode 100644 index a7e2e5480df..00000000000 --- a/TAO/performance-tests/RTCorba/Thread_Pool/fudge_priorities.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -#include "ace/Sched_Params.h" - -void -fudge_priorities (CORBA::ORB_ptr orb) -{ - -#if defined (ACE_CONFIG_LINUX_H) - - // On Linux SCHED_OTHER default to 0, while other scheduling classes - // start at 1. Therefore we do the following to get things in - // synch. - { - int thread_policy = - orb->orb_core ()->orb_params ()->sched_policy (); - - // Conversion. - int sched_policy = SCHED_OTHER; - if (thread_policy == THR_SCHED_FIFO) - sched_policy = SCHED_FIFO; - else if (thread_policy == THR_SCHED_RR) - thread_policy = SCHED_RR; - - sched_param sparam; - memset ((void *) &sparam, 0, sizeof sparam); - - sparam.sched_priority = - ACE_Sched_Params::priority_min (sched_policy); - - int result = - pthread_setschedparam (pthread_self (), - sched_policy, - &sparam); - if (result != 0) - { - errno = result; - perror ("pthread_setschedparam"); - ACE_DEBUG ((LM_DEBUG, - "Priority = %d; Policy = %d\n", - sparam.sched_priority, - sched_policy)); - } - } - -#else /* ACE_CONFIG_LINUX_H */ - - ACE_UNUSED_ARG (orb); - -#endif /* ACE_CONFIG_LINUX_H */ - -} diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf b/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf index bbfe0d82654..dbb5dad8ef0 100644 --- a/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf +++ b/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf @@ -1,10 +1,12 @@ -# Regular test -# static RT_ORB_Loader "-ORBPriorityMapping linear" +# Options for exclusive transport strategy +static Client_Strategy_Factory "-ORBTransportMuxStrategy EXCLUSIVE" + +# Options required for regular testing; comment out for real-time testing +static RT_ORB_Loader "-ORBPriorityMapping linear" -# For testing of RT threads -static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" -# For testing of RT threads (with native priority) +# For real-time testing (with native priority), uncomment the following line: # static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" -static Client_Strategy_Factory "-ORBTransportMuxStrategy EXCLUSIVE" diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf.xml b/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf.xml index 9f8ca1f764a..5a8fa8250ef 100644 --- a/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf.xml +++ b/TAO/performance-tests/RTCorba/Thread_Pool/svc.conf.xml @@ -1,11 +1,12 @@ <?xml version='1.0'?> -<!-- Converted from ./performance-tests/RTCorba/Thread_Pool/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- Regular test --> - <!-- static RT_ORB_Loader "-ORBPriorityMapping linear" --> - <!-- For testing of RT threads --> - <static id="RT_ORB_Loader" params="-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM"/> - <!-- For testing of RT threads (with native priority) --> - <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> + <!-- Options for exclusive transport strategy --> <static id="Client_Strategy_Factory" params="-ORBTransportMuxStrategy EXCLUSIVE"/> + <!-- Options required for regular testing --> + <static id="RT_ORB_Loader" params="-ORBPriorityMapping linear"/> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> + <!-- For real-time testing (with native priority), uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> </ACE_Svc_Conf> diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 4af7d6e9182..8ef7aad212f 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -473,6 +473,9 @@ CORBA::SystemException::_info (void) const case TAO_AMH_REPLY_LOCATION_CODE: location = "Failure when trying to send AMH reply"; break; + case TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE: + location = "Failure in thread creation for RTCORBA thread pool"; + break; default: location = "unknown location"; } diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index c04eb14d8ae..9cbae2a919f 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -124,6 +124,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ reverse_lock_ (*lock_), non_servant_upcall_condition_ (thread_lock_), non_servant_upcall_in_progress_ (0), + non_servant_upcall_nesting_level_ (0), non_servant_upcall_thread_ (ACE_OS::NULL_thread), root_ (0), default_validator_ (orb_core), @@ -1211,14 +1212,28 @@ TAO_Object_Adapter::iteratable_poa_name::end (void) const TAO_Object_Adapter::Non_Servant_Upcall::Non_Servant_Upcall (TAO_POA &poa) : object_adapter_ (poa.object_adapter ()), - poa_ (poa) + poa_ (poa), + previous_ (0) { - // Mark the fact that a non-servant upcall is in progress. - this->object_adapter_.non_servant_upcall_in_progress_ = this; + // Check if this is a nested non_servant_upcall. + if (this->object_adapter_.non_servant_upcall_nesting_level_ != 0) + { + // Remember previous instance of non_servant_upcall. + this->previous_ = this->object_adapter_.non_servant_upcall_in_progress_; + + // Assert that the thread is the same as the one before. + ACE_ASSERT (this->object_adapter_.non_servant_upcall_thread_ == ACE_OS::thr_self ()); + } // Remember which thread is calling the adapter activators. this->object_adapter_.non_servant_upcall_thread_ = ACE_OS::thr_self (); + // Mark the fact that a non-servant upcall is in progress. + this->object_adapter_.non_servant_upcall_in_progress_ = this; + + // Adjust the nesting level. + this->object_adapter_.non_servant_upcall_nesting_level_++; + // Release the Object Adapter lock. this->object_adapter_.lock ().release (); } @@ -1228,34 +1243,41 @@ TAO_Object_Adapter::Non_Servant_Upcall::~Non_Servant_Upcall (void) // Reacquire the Object Adapter lock. this->object_adapter_.lock ().acquire (); - // We are no longer in a non-servant upcall. - this->object_adapter_.non_servant_upcall_in_progress_ = 0; + // We are done with this nested upcall. + this->object_adapter_.non_servant_upcall_in_progress_ = this->previous_; - // Reset thread id. - this->object_adapter_.non_servant_upcall_thread_ = - ACE_OS::NULL_thread; + // Adjust the nesting level. + this->object_adapter_.non_servant_upcall_nesting_level_--; - // Check if all pending requests are over. - if (this->poa_.waiting_destruction () && - this->poa_.outstanding_requests () == 0) + // If we are at the outer nested upcall. + if (this->object_adapter_.non_servant_upcall_nesting_level_ == 0) { - ACE_TRY_NEW_ENV - { - this->poa_.complete_destruction_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY + // Reset thread id. + this->object_adapter_.non_servant_upcall_thread_ = + ACE_OS::NULL_thread; + + // Check if all pending requests are over. + if (this->poa_.waiting_destruction () && + this->poa_.outstanding_requests () == 0) { - // Ignore exceptions - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_POA::~complete_destruction_i"); + ACE_TRY_NEW_ENV + { + this->poa_.complete_destruction_i (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + // Ignore exceptions + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_POA::~complete_destruction_i"); + } + ACE_ENDTRY; } - ACE_ENDTRY; - } - // If locking is enabled. - if (this->object_adapter_.enable_locking_) - // Wakeup all waiting threads. - this->object_adapter_.non_servant_upcall_condition_.broadcast (); + // If locking is enabled. + if (this->object_adapter_.enable_locking_) + // Wakeup all waiting threads. + this->object_adapter_.non_servant_upcall_condition_.broadcast (); + } } TAO_Object_Adapter::Servant_Upcall::Servant_Upcall (TAO_ORB_Core *oc) diff --git a/TAO/tao/PortableServer/Object_Adapter.h b/TAO/tao/PortableServer/Object_Adapter.h index 28304a01fa4..959ea87efc3 100644 --- a/TAO/tao/PortableServer/Object_Adapter.h +++ b/TAO/tao/PortableServer/Object_Adapter.h @@ -640,6 +640,7 @@ public: TAO_Object_Adapter &object_adapter_; TAO_POA &poa_; + Non_Servant_Upcall *previous_; }; friend class Non_Servant_Upcall; @@ -843,6 +844,9 @@ private: /// upcall is in progress, this pointer is zero. Non_Servant_Upcall *non_servant_upcall_in_progress_; + /// Current nesting level of non_servant_upcalls. + unsigned int non_servant_upcall_nesting_level_; + /// Id of thread making the non-servant upcall. ACE_thread_t non_servant_upcall_thread_; diff --git a/TAO/tao/PortableServer/POA.h b/TAO/tao/PortableServer/POA.h index f366b191441..3be75b6328c 100644 --- a/TAO/tao/PortableServer/POA.h +++ b/TAO/tao/PortableServer/POA.h @@ -506,7 +506,7 @@ public: virtual void *thread_pool (void) const; - CORBA::Policy *server_protocol (void); + virtual CORBA::Policy *server_protocol (void); protected: diff --git a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp index c5866dc45e3..820fb2f2565 100644 --- a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp +++ b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp @@ -39,29 +39,29 @@ ACE_RCSID(Strategies, Linear_Network_Priority_Mapping, "$Id$") static int dscp [] = - { - // IPDSFIELD_DSCP_DEFAULT , - IPDSFIELD_DSCP_CS1 , - IPDSFIELD_DSCP_CS2 , - IPDSFIELD_DSCP_CS3 , - IPDSFIELD_DSCP_CS4 , - IPDSFIELD_DSCP_CS5 , - IPDSFIELD_DSCP_CS6 , - IPDSFIELD_DSCP_CS7 , - IPDSFIELD_DSCP_AF11 , - IPDSFIELD_DSCP_AF12 , - IPDSFIELD_DSCP_AF13 , - IPDSFIELD_DSCP_AF21 , - IPDSFIELD_DSCP_AF22 , - IPDSFIELD_DSCP_AF23 , - IPDSFIELD_DSCP_AF31 , - IPDSFIELD_DSCP_AF32 , - IPDSFIELD_DSCP_AF33 , - IPDSFIELD_DSCP_AF41 , - IPDSFIELD_DSCP_AF42 , - IPDSFIELD_DSCP_AF43 , - IPDSFIELD_DSCP_EF - }; +{ + // IPDSFIELD_DSCP_DEFAULT , + IPDSFIELD_DSCP_CS1 , + IPDSFIELD_DSCP_CS2 , + IPDSFIELD_DSCP_CS3 , + IPDSFIELD_DSCP_CS4 , + IPDSFIELD_DSCP_CS5 , + IPDSFIELD_DSCP_CS6 , + IPDSFIELD_DSCP_CS7 , + IPDSFIELD_DSCP_AF11 , + IPDSFIELD_DSCP_AF12 , + IPDSFIELD_DSCP_AF13 , + IPDSFIELD_DSCP_AF21 , + IPDSFIELD_DSCP_AF22 , + IPDSFIELD_DSCP_AF23 , + IPDSFIELD_DSCP_AF31 , + IPDSFIELD_DSCP_AF32 , + IPDSFIELD_DSCP_AF33 , + IPDSFIELD_DSCP_AF41 , + IPDSFIELD_DSCP_AF42 , + IPDSFIELD_DSCP_AF43 , + IPDSFIELD_DSCP_EF +}; /* @@ -92,16 +92,18 @@ static const char *dscp_char[]= */ TAO_Linear_Network_Priority_Mapping::TAO_Linear_Network_Priority_Mapping (long policy) - :policy_ (policy) + : policy_ (policy) { - this->min_ = 0; //ACE_Sched_Params::priority_min (this->policy_); - this->max_ = 32767; //ACE_Sched_Params::priority_max (this->policy_); - + this->min_ = 0; + this->max_ = 32767; + if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - "Min = %d\n Max = %d\n", - this->min_, - this->max_)); + "Min = %d\n" + "Max = %d\n", + this->min_, + this->max_)); + this->increment_ = (((this->max_ - this->min_) + 1) / 20) + 1; } @@ -111,23 +113,23 @@ TAO_Linear_Network_Priority_Mapping::~TAO_Linear_Network_Priority_Mapping (void) CORBA::Boolean TAO_Linear_Network_Priority_Mapping::to_network (RTCORBA::Priority corba_priority, - RTCORBA::NetworkPriority &network_priority) + RTCORBA::NetworkPriority &network_priority) { network_priority = dscp [(corba_priority - this->min_) / this->increment_]; if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - "TAO_Linear_Network_Priority_Mapping::to_network = %x increment = %d\n", - network_priority, - this->increment_)); + "TAO_Linear_Network_Priority_Mapping::to_network = %x increment = %d\n", + network_priority, + this->increment_)); return 1; } CORBA::Boolean TAO_Linear_Network_Priority_Mapping::to_CORBA (RTCORBA::NetworkPriority /*network_priority*/, - RTCORBA::Priority &/*corba_priority*/) + RTCORBA::Priority &/*corba_priority*/) { if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, - "TAO_Linear_Network_Priority_Mapping::to_corba\n")); + "TAO_Linear_Network_Priority_Mapping::to_corba\n")); return 1; } diff --git a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h index e6514166f6a..bd63133432b 100644 --- a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h +++ b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h @@ -9,7 +9,7 @@ // Linear_Network_Priority_Mapping.h // // = DESCRIPTION -// Declares the Linear_Network_Priority_Mapping interface, +// Declares the Linear_Network_Priority_Mapping interface, // // = AUTHOR // Yamuna Krishnamurthy (yamuna@oomworks.com) @@ -50,7 +50,7 @@ public: virtual CORBA::Boolean to_network (RTCORBA::Priority corba_priority, - RTCORBA::NetworkPriority &network_priority); + RTCORBA::NetworkPriority &network_priority); virtual CORBA::Boolean to_CORBA (RTCORBA::NetworkPriority network_priority, RTCORBA::Priority &corba_priority); diff --git a/TAO/tao/RTCORBA/RT_ORB.cpp b/TAO/tao/RTCORBA/RT_ORB.cpp index 2c594b9a3d3..0d442a2e2b0 100644 --- a/TAO/tao/RTCORBA/RT_ORB.cpp +++ b/TAO/tao/RTCORBA/RT_ORB.cpp @@ -7,6 +7,7 @@ #include "tao/ORB_Core.h" #include "tao/RTCORBA/Thread_Pool.h" #include "tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h" +#include "ace/Sched_Params.h" #if ! defined (__ACE_INLINE__) #include "RT_ORB.i" @@ -235,7 +236,7 @@ TAO_RT_ORB::create_tcp_protocol_properties (CORBA::Long send_buffer_size, CORBA::Boolean keep_alive, CORBA::Boolean dont_route, CORBA::Boolean no_delay, - CORBA::Boolean enable_network_priority + CORBA::Boolean enable_network_priority ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException )) { @@ -246,7 +247,7 @@ TAO_RT_ORB::create_tcp_protocol_properties (CORBA::Long send_buffer_size, keep_alive, dont_route, no_delay, - enable_network_priority), + enable_network_priority), CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_NO)); ACE_CHECK_RETURN (RTCORBA::TCPProtocolProperties::_nil ()); @@ -401,6 +402,50 @@ TAO_RT_ORB::tp_manager (void) return *this->tp_manager_; } +/* static */ +int +TAO_RT_ORB::modify_thread_scheduling_policy (CORBA::ORB_ptr orb) +{ + // + // This method changes the scheduling policy of the calling thread + // to match the scheduling policy specified in the svc.conf file. + // The priority of the calling thread will be set to the minimum + // priority supported by that scheduling policy. + // + // This method make sense on those platform (e.g., Linux) where + // PTHREAD_SCOPE_SYSTEM is the only scheduling scope supported. On + // other platforms, this method is a no-op since the only way to get + // the real-time threading behavior is to setup the + // PTHREAD_SCOPE_SYSTEM scheduling scope when a thread is being + // created. On such platforms, one can set the correct scheduling + // scope and policy when creating the thread, thus not needing to + // use this method. + // + +#if defined (linux) + + int sched_policy = + orb->orb_core ()->orb_params ()->ace_sched_policy (); + + int minimum_priority = + ACE_Sched_Params::priority_min (sched_policy); + + ACE_hthread_t thread_id; + ACE_Thread::self (thread_id); + + return ACE_Thread::setprio (thread_id, + minimum_priority, + sched_policy); + +#else /* linux */ + + ACE_UNUSED_ARG (orb); + ACE_NOTSUP_RETURN (-1); + +#endif /* linux */ + +} + //////////////////////////////////////////////////////////////////////////////// #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/RTCORBA/RT_ORB.h b/TAO/tao/RTCORBA/RT_ORB.h index 70603bc5f80..99654bda1a6 100644 --- a/TAO/tao/RTCORBA/RT_ORB.h +++ b/TAO/tao/RTCORBA/RT_ORB.h @@ -150,7 +150,7 @@ public: CORBA::Boolean keep_alive, CORBA::Boolean dont_route, CORBA::Boolean no_delay, - CORBA::Boolean enable_network_priority + CORBA::Boolean enable_network_priority ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException )); @@ -240,6 +240,23 @@ public: /// Get the Thread Pool Manager. TAO_Thread_Pool_Manager &tp_manager (void); + /** + * This method changes the scheduling policy of the calling thread + * to match the scheduling policy specified in the svc.conf file. + * The priority of the calling thread will be set to the minimum + * priority supported by that scheduling policy. + * + * This method make sense on those platform (e.g., Linux) where + * PTHREAD_SCOPE_SYSTEM is the only scheduling scope supported. On + * other platforms, this method is a no-op since the only way to get + * the real-time threading behavior is to setup the + * PTHREAD_SCOPE_SYSTEM scheduling scope when a thread is being + * created. On such platforms, one can set the correct scheduling + * scope and policy when creating the thread, thus not needing to + * use this method. + */ + static int modify_thread_scheduling_policy (CORBA::ORB_ptr orb); + protected: /// Protected destructor to enforce proper memory management of this /// reference counted object. diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp index dd7fe4bd959..d7a3dec278f 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp @@ -39,30 +39,15 @@ static const char *rt_poa_factory_directive = "dynamic TAO_RT_POA Service_Object TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (int priority_mapping_type, int network_priority_mapping_type, + int ace_sched_policy, long sched_policy, long scope_policy) : priority_mapping_type_ (priority_mapping_type), network_priority_mapping_type_ (network_priority_mapping_type), + ace_sched_policy_ (ace_sched_policy), sched_policy_ (sched_policy), - sched_policy_flags_ (0), scope_policy_ (scope_policy) { - switch (sched_policy_) - { - case ACE_SCHED_RR: - sched_policy_flags_ = THR_SCHED_RR; - break; - case ACE_SCHED_FIFO: - sched_policy_flags_ = THR_SCHED_FIFO; - break; - case ACE_SCHED_OTHER: - sched_policy_flags_ = THR_SCHED_DEFAULT; - break; - default: - ACE_DEBUG((LM_DEBUG, ACE_LIB_TEXT("(%N,%l) Unknown sched_policy value.\nDefaulting to THR_SCHED_DEFAULT for sched_policy_flags_.\n") )); - sched_policy_flags_ = THR_SCHED_DEFAULT; - break; - } } void @@ -109,16 +94,16 @@ TAO_RT_ORBInitializer::pre_init ( { case TAO_PRIORITY_MAPPING_CONTINUOUS: ACE_NEW (pm, - TAO_Continuous_Priority_Mapping (this->sched_policy_)); + TAO_Continuous_Priority_Mapping (this->ace_sched_policy_)); break; case TAO_PRIORITY_MAPPING_LINEAR: ACE_NEW (pm, - TAO_Linear_Priority_Mapping (this->sched_policy_)); + TAO_Linear_Priority_Mapping (this->ace_sched_policy_)); break; default: case TAO_PRIORITY_MAPPING_DIRECT: ACE_NEW (pm, - TAO_Direct_Priority_Mapping (this->sched_policy_)); + TAO_Direct_Priority_Mapping (this->ace_sched_policy_)); break; } @@ -149,7 +134,7 @@ TAO_RT_ORBInitializer::pre_init ( default: case TAO_NETWORK_PRIORITY_MAPPING_LINEAR: ACE_NEW (npm, - TAO_Linear_Network_Priority_Mapping (this->sched_policy_)); + TAO_Linear_Network_Priority_Mapping (this->ace_sched_policy_)); break; } @@ -232,57 +217,8 @@ TAO_RT_ORBInitializer::pre_init ( ACE_CHECK; tao_info->orb_core ()->orb_params ()->scope_policy (this->scope_policy_); - - /* - * We need to store sched_policy_flags_ and not sched_policy_ in the - * orb_params(), because in TAO_Thread_Lane::create_dynamic_threads(), - * the flags are passed to ACE_Task_Base::activate() in order to set - * the priority. - */ - tao_info->orb_core ()->orb_params ()->sched_policy (this->sched_policy_flags_); - - /* - * Based on what the scheduling policy is, set the priority to the lowest - * priority for that scheduling policy. We need to do this in order to - * set the pthread policy for pthread_setschedparam(). - * Also, we want the pthread policy and priority to be set to a sensible - * value, since the post_invoke() operation in the RT-POA will reset the - * CORBA priority to what it was before an incoming request. - */ - int priority; - ACE_hthread_t thr_id; - ACE_Thread::self(thr_id); - - int result = ACE_OS::thr_getprio(thr_id, priority); - if (result != 0) - { - ACE_ERROR ((LM_ERROR, - "(%N,%l) ACE_OS::thr_getprio failed, " - "priority %d errno: %d %m\n", - priority, - errno)); - return; - } - - const int priority_min = - ACE_Sched_Params::priority_min (this->sched_policy_); - const int priority_max = - ACE_Sched_Params::priority_max (this->sched_policy_); - - if (priority < priority_min || priority > priority_max) // Check this - { - priority = priority_min; - } - - result = ACE_OS::thr_setprio(thr_id, priority, this->sched_policy_); - if (result != 0) - { - ACE_ERROR ((LM_ERROR, - "(%N,%l) ACE_OS::thr_setprio failed, " - "priority %d errno: %d %m\n", - priority, - errno)); - } + tao_info->orb_core ()->orb_params ()->sched_policy (this->sched_policy_); + tao_info->orb_core ()->orb_params ()->ace_sched_policy (this->ace_sched_policy_); } void diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.h b/TAO/tao/RTCORBA/RT_ORBInitializer.h index ae59bccdbdf..cfb72d997b2 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.h +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.h @@ -44,19 +44,20 @@ class TAO_RTCORBA_Export TAO_RT_ORBInitializer : public: /// Priority mapping types enum - { - TAO_PRIORITY_MAPPING_CONTINUOUS, - TAO_PRIORITY_MAPPING_LINEAR, - TAO_PRIORITY_MAPPING_DIRECT - }; + { + TAO_PRIORITY_MAPPING_CONTINUOUS, + TAO_PRIORITY_MAPPING_LINEAR, + TAO_PRIORITY_MAPPING_DIRECT + }; enum - { - TAO_NETWORK_PRIORITY_MAPPING_LINEAR - }; + { + TAO_NETWORK_PRIORITY_MAPPING_LINEAR + }; TAO_RT_ORBInitializer (int priority_mapping_type, - int network_priority_mapping_type, + int network_priority_mapping_type, + int ace_sched_policy, long sched_policy, long scope_policy); @@ -72,8 +73,8 @@ private: /// Register RTCORBA policy factories. void register_policy_factories ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL); + PortableInterceptor::ORBInitInfo_ptr info + ACE_ENV_ARG_DECL); private: @@ -88,21 +89,34 @@ private: /// Network Priority mapping type. int network_priority_mapping_type_; - /** Scheduling policy. This value is passed to ACE_OS::thr_setprio(). - * For POSIX pthreads, it maps directly to the pthread_setschedparam() policy - * parameter. Legal values are ACE_SCHED_RR, ACE_SCHED_FIFO, - * ACE_SCHED_OTHER, ACE_SCHED_*, etc. - */ + /// Scheduling policy. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by + * functions like ACE_OS::thr_setprio() and + * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR, + * ACE_SCHED_FIFO, and ACE_SCHED_OTHER. + */ + int ace_sched_policy_; + + /// Scheduling policy flag. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCHED_RR, + * THR_SCHED_FIFO, and THR_SCHED_DEFAULT. + */ long sched_policy_; - /** Scheduling policy flags. This value is passed as part of the - * flags argument to ACE_Task_Base::activate(). Legal values are - * THR_SCHED_RR, THR_SCHED_FIFO, THR_SCHED_DEFAULT, etc. - */ - long sched_policy_flags_; - - /// Scope policy. + /// Scheduling scope flag. + /** + * Scheduling policy specified by the user through the + * -ORBScopePolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCOPE_SYSTEM and + * THR_SCOPE_PROCESS. + */ long scope_policy_; + }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp index e96962f67f8..f9cc473e993 100644 --- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp +++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp @@ -36,7 +36,8 @@ TAO_RT_ORB_Loader::init (int argc, TAO_RT_ORBInitializer::TAO_PRIORITY_MAPPING_DIRECT; int network_priority_mapping_type = TAO_RT_ORBInitializer::TAO_NETWORK_PRIORITY_MAPPING_LINEAR; - long sched_policy = -1; + int ace_sched_policy = ACE_SCHED_OTHER; + long sched_policy = THR_SCHED_DEFAULT; long scope_policy = THR_SCOPE_PROCESS; int curarg = 0; @@ -79,13 +80,22 @@ TAO_RT_ORB_Loader::init (int argc, if (ACE_OS::strcasecmp (name, ACE_LIB_TEXT("SCHED_OTHER")) == 0) - sched_policy = ACE_SCHED_OTHER; + { + ace_sched_policy = ACE_SCHED_OTHER; + sched_policy = THR_SCHED_DEFAULT; + } else if (ACE_OS::strcasecmp (name, ACE_LIB_TEXT("SCHED_FIFO")) == 0) - sched_policy = ACE_SCHED_FIFO; + { + ace_sched_policy = ACE_SCHED_FIFO; + sched_policy = THR_SCHED_FIFO; + } else if (ACE_OS::strcasecmp (name, ACE_LIB_TEXT("SCHED_RR")) == 0) - sched_policy = ACE_SCHED_RR; + { + ace_sched_policy = ACE_SCHED_RR; + sched_policy = THR_SCHED_RR; + } else ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("RT_ORB_Loader - unknown argument") @@ -115,18 +125,18 @@ TAO_RT_ORB_Loader::init (int argc, } } else if (ACE_OS::strcasecmp (argv[curarg], - ACE_LIB_TEXT("-ORBNetworkPriorityMapping")) == 0) + ACE_LIB_TEXT("-ORBNetworkPriorityMapping")) == 0) { curarg++; if (curarg < argc) { ACE_TCHAR* name = argv[curarg]; - + if (ACE_OS::strcasecmp (name, ACE_LIB_TEXT("linear")) == 0) network_priority_mapping_type = TAO_RT_ORBInitializer::TAO_NETWORK_PRIORITY_MAPPING_LINEAR; - } + } } else { @@ -139,12 +149,6 @@ TAO_RT_ORB_Loader::init (int argc, } } - if (sched_policy == -1) { - ACE_ERROR_RETURN( (LM_ERROR, - ACE_LIB_TEXT("(%N,%l) -ORBSchedPolicy not defined.\n") ), - -1); - } - // Register the ORB initializer. ACE_TRY_NEW_ENV { @@ -155,7 +159,8 @@ TAO_RT_ORB_Loader::init (int argc, /// Register the RTCORBA ORBInitializer. ACE_NEW_THROW_EX (temp_orb_initializer, TAO_RT_ORBInitializer (priority_mapping_type, - network_priority_mapping_type, + network_priority_mapping_type, + ace_sched_policy, sched_policy, scope_policy), CORBA::NO_MEMORY ( diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index 98ce050c972..7d9118a9333 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -297,8 +297,7 @@ TAO_Thread_Lane::create_dynamic_threads (CORBA::ULong number_of_threads) long flags = default_flags | - orb_core.orb_params ()->scope_policy () | - orb_core.orb_params ()->sched_policy (); + orb_core.orb_params ()->thread_creation_flags (); // Activate the threads. int result = @@ -822,8 +821,13 @@ TAO_Thread_Pool_Manager::create_threadpool_helper (TAO_Thread_Pool *thread_pool // Throw exception in case of errors. if (result != 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), - result); + ACE_THROW_RETURN ( + CORBA::INTERNAL ( + CORBA::SystemException::_tao_minor_code ( + TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE, + errno), + CORBA::COMPLETED_NO), + result); // Bind thread to internal table. result = diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index e6333da1bfc..91c828cd5e3 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -833,6 +833,7 @@ const CORBA::ULong TAO_POA_BEING_DESTROYED = (0x11U << 7); const CORBA::ULong TAO_POA_INACTIVE = (0x12U << 7); const CORBA::ULong TAO_CONNECTOR_REGISTRY_INIT_LOCATION_CODE = (0x13U << 7); const CORBA::ULong TAO_AMH_REPLY_LOCATION_CODE = (0x14U << 7); +const CORBA::ULong TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE = (0x15U << 7); // *Don't* use TAO_<location>_MINOR_CODE greater than 0x1FU! //@} diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index 20836a5255a..3d721daf21f 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -22,6 +22,7 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void) use_lite_protocol_ (0), use_dotted_decimal_addresses_ (0), std_profile_components_ (1), + ace_sched_policy_ (ACE_SCHED_OTHER), sched_policy_ (THR_SCHED_DEFAULT), scope_policy_ (THR_SCOPE_PROCESS), single_read_optimization_ (1) diff --git a/TAO/tao/params.h b/TAO/tao/params.h index f0f8d226a8f..f7e44bcbfbf 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -137,14 +137,43 @@ public: int std_profile_components (void) const; void std_profile_components (int x); - /// Thread scheduling policy. + /// Scheduling policy. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by + * functions like ACE_OS::thr_setprio() and + * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR, + * ACE_SCHED_FIFO, and ACE_SCHED_OTHER. + */ + int ace_sched_policy (void) const; + void ace_sched_policy (int x); + + /// Scheduling policy flag. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCHED_RR, + * THR_SCHED_FIFO, and THR_SCHED_DEFAULT. + */ long sched_policy (void) const; void sched_policy (long x); - /// Thread scope policy. + /// Scheduling scope flag. + /** + * Scheduling policy specified by the user through the + * -ORBScopePolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCOPE_SYSTEM and + * THR_SCOPE_PROCESS. + */ long scope_policy (void) const; void scope_policy (long x); + /// Thread creation flags. + /** + * Shorthand for OR'ing together the scope_policy and sched_policy. + */ + long thread_creation_flags (void) const; + /// Single read optimization. int single_read_optimization (void) const; void single_read_optimization (int x); @@ -209,10 +238,32 @@ private: /// If true then the standard OMG components are not generated. int std_profile_components_; - /// Thread scheduling policy. + /// Scheduling policy. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by + * functions like ACE_OS::thr_setprio() and + * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR, + * ACE_SCHED_FIFO, and ACE_SCHED_OTHER. + */ + int ace_sched_policy_; + + /// Scheduling policy flag. + /** + * Scheduling policy specified by the user through the + * -ORBSchedPolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCHED_RR, + * THR_SCHED_FIFO, and THR_SCHED_DEFAULT. + */ long sched_policy_; - /// Thread scope policy. + /// Scheduling scope flag. + /** + * Scheduling policy specified by the user through the + * -ORBScopePolicy option. This value is typically used by ACE + * thread creation functions. Legal values are THR_SCOPE_SYSTEM and + * THR_SCOPE_PROCESS. + */ long scope_policy_; /// Single read optimization. diff --git a/TAO/tao/params.i b/TAO/tao/params.i index fa5d9d315e7..6c465f1808c 100644 --- a/TAO/tao/params.i +++ b/TAO/tao/params.i @@ -147,6 +147,18 @@ TAO_ORB_Parameters::nodelay (int x) this->nodelay_ = x; } +ACE_INLINE int +TAO_ORB_Parameters::ace_sched_policy (void) const +{ + return this->ace_sched_policy_; +} + +ACE_INLINE void +TAO_ORB_Parameters::ace_sched_policy (int x) +{ + this->ace_sched_policy_ = x; +} + ACE_INLINE long TAO_ORB_Parameters::sched_policy (void) const { @@ -171,6 +183,14 @@ TAO_ORB_Parameters::scope_policy (long x) this->scope_policy_ = x; } +ACE_INLINE long +TAO_ORB_Parameters::thread_creation_flags (void) const +{ + return + this->scope_policy () | + this->sched_policy (); +} + ACE_INLINE int TAO_ORB_Parameters::single_read_optimization (void) const { diff --git a/TAO/tests/POA/Makefile b/TAO/tests/POA/Makefile index 657a2a9ba1b..f3debe66146 100644 --- a/TAO/tests/POA/Makefile +++ b/TAO/tests/POA/Makefile @@ -18,6 +18,7 @@ DIRS = POA_Destruction \ Object_Reactivation \ Non_Servant_Upcalls \ MT_Servant_Locator \ + Nested_Non_Servant_Upcalls \ Single_Threaded_POA \ Persistent_ID \ Policies \ diff --git a/TAO/tests/POA/Makefile.bor b/TAO/tests/POA/Makefile.bor index 2e889b4cdb8..9f8c1904990 100644 --- a/TAO/tests/POA/Makefile.bor +++ b/TAO/tests/POA/Makefile.bor @@ -11,6 +11,7 @@ DIRS = \ Identity \ Non_Servant_Upcalls \ MT_Servant_Locator \ + Nested_Non_Servant_Upcalls \ Single_Threaded_POA \ Persistent_ID \ Policies \ diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/Makefile b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Makefile new file mode 100644 index 00000000000..7bd80a500b3 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Makefile @@ -0,0 +1,1023 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif # ! TAO_ROOT + +LDLIBS = -lTAO + +IDL_FILES = test +IDL_SRC = testC.cpp testS.cpp +PROG_SRCS = $(IDL_SRC) Nested_Non_Servant_Upcalls.cpp + +LSRC = $(PROG_SRCS) + +SVR_OBJS = testC.o testS.o Nested_Non_Servant_Upcalls.o + +BIN_UNCHECKED = Nested_Non_Servant_Upcalls + +TAO_IDLFLAGS += -Ge 1 + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU + +ifeq ($(minimum_corba),0) + BIN = $(BIN_UNCHECKED) +endif # minimum_corba + +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +include $(TAO_ROOT)/taoconfig.mk + +.PRECIOUS: testC.h testC.i testC.cpp testS.h testS.i testS.cpp testS_T.h testS_T.i testS_T.cpp + +Nested_Non_Servant_Upcalls: $(addprefix $(VDIR),$(SVR_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(TAO_SRVR_LIBS) $(POSTLINK) + +realclean: clean + -$(RM) testC.* testS.* testS_T.* + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/testC.o .obj/testC.so .shobj/testC.o .shobj/testC.so: testC.cpp testC.h $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/Time_Value.inl \ + $(ACE_ROOT)/ace/Default_Constants.h \ + $(ACE_ROOT)/ace/Global_Macros.h \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/String_Base.h \ + $(ACE_ROOT)/ace/String_Base_Const.h \ + $(ACE_ROOT)/ace/String_Base.i \ + $(ACE_ROOT)/ace/String_Base.cpp \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Auto_Ptr.h \ + $(ACE_ROOT)/ace/Auto_Ptr.i \ + $(ACE_ROOT)/ace/Auto_Ptr.cpp \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/XML_Svc_Conf.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(ACE_ROOT)/ace/Exception_Macros.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any_T.h \ + $(TAO_ROOT)/tao/Any.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.i \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/AbstractBase.h \ + $(TAO_ROOT)/tao/AbstractBase.inl \ + $(TAO_ROOT)/tao/Any_T.inl \ + $(TAO_ROOT)/tao/Any_T.cpp \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/ServicesC.h \ + $(TAO_ROOT)/tao/ServicesC.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ObjectIdListC.h \ + $(TAO_ROOT)/tao/ObjectIdListC.i \ + $(TAO_ROOT)/tao/objectid.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/WrongTransactionC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.h \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.i \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.h \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i testC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Set.h \ + $(TAO_ROOT)/tao/Policy_Set.i \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/DLL.h \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PICurrent.h \ + $(TAO_ROOT)/tao/PICurrent.inl \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Exit.h \ + $(ACE_ROOT)/ace/Thread_Control.h \ + $(ACE_ROOT)/ace/Thread_Control.inl \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Framework_Component.h \ + $(ACE_ROOT)/ace/Framework_Component.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.h \ + $(ACE_ROOT)/ace/Framework_Component_T.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/ORB_Core_Auto_Ptr.h \ + $(TAO_ROOT)/tao/ORB_Core_Auto_Ptr.inl \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Condition.h \ + $(TAO_ROOT)/tao/Condition.inl \ + $(TAO_ROOT)/tao/Condition.cpp \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/LF_Invocation_Event.h \ + $(TAO_ROOT)/tao/LF_Event.h \ + $(TAO_ROOT)/tao/LF_Event.inl \ + $(TAO_ROOT)/tao/LF_Invocation_Event.inl \ + $(TAO_ROOT)/tao/GIOP_Message_Version.h \ + $(TAO_ROOT)/tao/GIOP_Message_Version.inl \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Transport.h \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(ACE_ROOT)/ace/Recyclable.h \ + $(ACE_ROOT)/ace/Recyclable.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Transport_Timer.h \ + $(TAO_ROOT)/tao/Incoming_Message_Queue.h \ + $(TAO_ROOT)/tao/Pluggable_Messaging_Utils.h \ + $(TAO_ROOT)/tao/Pluggable_Messaging_Utils.i \ + $(TAO_ROOT)/tao/Incoming_Message_Queue.inl \ + $(TAO_ROOT)/tao/Synch_Refcountable.h \ + $(ACE_ROOT)/ace/Refcountable.h \ + $(ACE_ROOT)/ace/Refcountable.inl \ + $(TAO_ROOT)/tao/Synch_Refcountable.inl \ + $(TAO_ROOT)/tao/Codeset_Translator_Factory.h \ + $(TAO_ROOT)/tao/Codeset_Translator_Factory_T.h \ + $(TAO_ROOT)/tao/Codeset_Translator_Factory_T.cpp \ + $(TAO_ROOT)/tao/Transport.inl \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/RequestInfo_Util.h \ + $(TAO_ROOT)/tao/ClientRequestInfo_i.h \ + $(TAO_ROOT)/tao/ClientRequestInfo_i.inl \ + $(TAO_ROOT)/tao/ClientInterceptorAdapter.h \ + $(TAO_ROOT)/tao/ClientInterceptorAdapter.inl + +.obj/testS.o .obj/testS.so .shobj/testS.o .shobj/testS.so: testS.cpp testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/Time_Value.inl \ + $(ACE_ROOT)/ace/Default_Constants.h \ + $(ACE_ROOT)/ace/Global_Macros.h \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/String_Base.h \ + $(ACE_ROOT)/ace/String_Base_Const.h \ + $(ACE_ROOT)/ace/String_Base.i \ + $(ACE_ROOT)/ace/String_Base.cpp \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Auto_Ptr.h \ + $(ACE_ROOT)/ace/Auto_Ptr.i \ + $(ACE_ROOT)/ace/Auto_Ptr.cpp \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/XML_Svc_Conf.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(ACE_ROOT)/ace/Exception_Macros.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any_T.h \ + $(TAO_ROOT)/tao/Any.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.i \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/AbstractBase.h \ + $(TAO_ROOT)/tao/AbstractBase.inl \ + $(TAO_ROOT)/tao/Any_T.inl \ + $(TAO_ROOT)/tao/Any_T.cpp \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/ServicesC.h \ + $(TAO_ROOT)/tao/ServicesC.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ObjectIdListC.h \ + $(TAO_ROOT)/tao/ObjectIdListC.i \ + $(TAO_ROOT)/tao/objectid.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/WrongTransactionC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.h \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.i \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.h \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i testC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(ACE_ROOT)/ace/Atomic_Op.h \ + $(ACE_ROOT)/ace/Atomic_Op_T.h \ + $(ACE_ROOT)/ace/Atomic_Op_T.i \ + $(ACE_ROOT)/ace/Atomic_Op_T.cpp \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + testS_T.h testS_T.i testS_T.cpp testS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/DLL.h \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Default_Policy_Validator.h \ + $(TAO_ROOT)/tao/Policy_Validator.h \ + $(TAO_ROOT)/tao/PortableServer/POA_Policy_Set.h \ + $(TAO_ROOT)/tao/PortableServer/POA_Policies.h \ + $(TAO_ROOT)/tao/PortableServer/POA_Policies.i \ + $(TAO_ROOT)/tao/Policy_Set.h \ + $(TAO_ROOT)/tao/Policy_Set.i \ + $(TAO_ROOT)/tao/PortableServer/POA_Policy_Set.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/PICurrent.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/PICurrent.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Exit.h \ + $(ACE_ROOT)/ace/Thread_Control.h \ + $(ACE_ROOT)/ace/Thread_Control.inl \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Framework_Component.h \ + $(ACE_ROOT)/ace/Framework_Component.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.h \ + $(ACE_ROOT)/ace/Framework_Component_T.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_Version.h \ + $(TAO_ROOT)/tao/GIOP_Message_Version.inl \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core_Auto_Ptr.h \ + $(TAO_ROOT)/tao/ORB_Core_Auto_Ptr.inl \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/IFR_Client_Adapter.h \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/RequestInfo_Util.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/tao/PortableServer/ServerInterceptorAdapter.h \ + $(TAO_ROOT)/tao/PortableServer/ServerInterceptorAdapter.inl \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service_Base.h \ + $(ACE_ROOT)/ace/Dynamic_Service.i \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp + +.obj/Nested_Non_Servant_Upcalls.o .obj/Nested_Non_Servant_Upcalls.so .shobj/Nested_Non_Servant_Upcalls.o .shobj/Nested_Non_Servant_Upcalls.so: Nested_Non_Servant_Upcalls.cpp testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/Time_Value.inl \ + $(ACE_ROOT)/ace/Default_Constants.h \ + $(ACE_ROOT)/ace/Global_Macros.h \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/String_Base.h \ + $(ACE_ROOT)/ace/String_Base_Const.h \ + $(ACE_ROOT)/ace/String_Base.i \ + $(ACE_ROOT)/ace/String_Base.cpp \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Auto_Ptr.h \ + $(ACE_ROOT)/ace/Auto_Ptr.i \ + $(ACE_ROOT)/ace/Auto_Ptr.cpp \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/XML_Svc_Conf.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(ACE_ROOT)/ace/Exception_Macros.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any_T.h \ + $(TAO_ROOT)/tao/Any.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/Policy_ForwardC.i \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/AbstractBase.h \ + $(TAO_ROOT)/tao/AbstractBase.inl \ + $(TAO_ROOT)/tao/Any_T.inl \ + $(TAO_ROOT)/tao/Any_T.cpp \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/ServicesC.h \ + $(TAO_ROOT)/tao/ServicesC.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ObjectIdListC.h \ + $(TAO_ROOT)/tao/ObjectIdListC.i \ + $(TAO_ROOT)/tao/objectid.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/WrongTransactionC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.h \ + $(TAO_ROOT)/tao/ObjectReferenceTemplateC.i \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.h \ + $(TAO_ROOT)/tao/Messaging_SyncScopeC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i testC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(ACE_ROOT)/ace/Atomic_Op.h \ + $(ACE_ROOT)/ace/Atomic_Op_T.h \ + $(ACE_ROOT)/ace/Atomic_Op_T.i \ + $(ACE_ROOT)/ace/Atomic_Op_T.cpp \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + testS_T.h testS_T.i testS_T.cpp testS.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/DLL.h \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Exit.h \ + $(ACE_ROOT)/ace/Thread_Control.h \ + $(ACE_ROOT)/ace/Thread_Control.inl \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Framework_Component.h \ + $(ACE_ROOT)/ace/Framework_Component.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.h \ + $(ACE_ROOT)/ace/Framework_Component_T.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Notification_Strategy.h \ + $(ACE_ROOT)/ace/Notification_Strategy.inl \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.cpp b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.cpp new file mode 100644 index 00000000000..8a4ccd13f14 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.cpp @@ -0,0 +1,315 @@ +// $Id$ + +//======================================================================== +// +// = LIBRARY +// TAO/tests/POA/Nested_Non_Servant_Upcalls +// +// = FILENAME +// Nested_Non_Servant_Upcalls.cpp +// +// = DESCRIPTION +// This program tests that nested non-servant upcalls are handled +// correctly. +// +// = AUTHOR +// Irfan Pyarali +// +//========================================================================= + +#include "testS.h" +#include "ace/Task.h" +#include "ace/Synch.h" + +class test_i : public virtual PortableServer::RefCountServantBase, + public virtual POA_test +{ +public: + + test_i (PortableServer::POA_ptr poa); + + ~test_i (void); + + void method (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + PortableServer::POA_var poa_; + +}; + +test_i::test_i (PortableServer::POA_ptr poa) + : poa_ (PortableServer::POA::_duplicate (poa)) +{ + ACE_DEBUG ((LM_DEBUG, + "test_i created: instance %x\n", + this)); +} + +test_i::~test_i (void) +{ + ACE_DEBUG ((LM_DEBUG, + "test_i destroyed: instance %x\n", + this)); +} + +void +test_i::method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +static int servant_activation_succeeded = 0; + +class Object_Activator : public ACE_Task_Base +{ +public: + + Object_Activator (ACE_Thread_Manager &thread_manager, + PortableServer::POA_ptr poa); + + int svc (void); + + ACE_Auto_Event object_activated_; + + PortableServer::POA_var poa_; + +}; + + +Object_Activator::Object_Activator (ACE_Thread_Manager &thread_manager, + PortableServer::POA_ptr poa) + : ACE_Task_Base (&thread_manager), + poa_ (PortableServer::POA::_duplicate (poa)) +{ +} + +int +Object_Activator::svc (void) +{ + ACE_TRY_NEW_ENV + { + test_i *servant = + new test_i (this->poa_.in ()); + + PortableServer::ServantBase_var safe_servant (servant); + + PortableServer::ObjectId_var id = + this->poa_->activate_object (servant + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + this->object_activated_.signal (); + + this->poa_->deactivate_object (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught in activator thread"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +Object_Activator *global_object_activator = 0; + +class Servant_Activator : + public PortableServer::ServantActivator +{ +public: + + Servant_Activator (PortableServer::POA_ptr poa); + + PortableServer::Servant incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::ForwardRequest)); + + void etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + PortableServer::POA_var poa_; + + PortableServer::ObjectId_var id_; + +}; + +Servant_Activator::Servant_Activator (PortableServer::POA_ptr poa) + : poa_ (PortableServer::POA::_duplicate (poa)) +{ +} + +PortableServer::Servant +Servant_Activator::incarnate (const PortableServer::ObjectId &, + PortableServer::POA_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::ForwardRequest)) +{ + test_i *servant = + new test_i (this->poa_.in ()); + + PortableServer::ServantBase_var safe_servant (servant); + + this->id_ = + this->poa_->activate_object (servant + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->poa_->deactivate_object (this->id_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + int result = + global_object_activator->activate (); + ACE_ASSERT (result != -1); + + ACE_Time_Value timeout (5); + + result = + global_object_activator->object_activated_.wait (&timeout, 0); + + if (result == 0) + { + ACE_DEBUG ((LM_DEBUG, + "Object Activator was able to make progress during " + "recursive non-servant upcall: test failed\n")); + + ACE_ASSERT (0); + } + else if (result == -1 && errno == ETIME) + { + ACE_DEBUG ((LM_DEBUG, + "Object Activator was not able to make progress during " + "recursive non-servant upcall: test succeeded\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, + "Unexpected error during event.wait (): %d\n", + result)); + + ACE_ASSERT (0); + } + + return new test_i (this->poa_.in ()); +} + +void +Servant_Activator::etherealize (const PortableServer::ObjectId &, + PortableServer::POA_ptr, + PortableServer::Servant servant, + CORBA::Boolean, + CORBA::Boolean + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + servant->_remove_ref (); +} + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::Object_var obj = + orb->resolve_initial_references ("RootPOA" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::PolicyList policies; + CORBA::ULong current_length = 0; + + policies.length (current_length + 1); + policies[current_length++] = + root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableServer::POA_var child_poa = + root_poa->create_POA ("child", + poa_manager.in (), + policies + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + Servant_Activator servant_activator (child_poa.in ()); + child_poa->set_servant_manager (&servant_activator + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::Object_var first_object = + child_poa->create_reference ("IDL:test:1.0" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + test_var first_test = + test::_narrow (first_object.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableServer::ObjectId_var id = + child_poa->reference_to_id (first_object.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_Thread_Manager thread_manager; + + Object_Activator object_activator (thread_manager, + child_poa.in ()); + + global_object_activator = + &object_activator; + + first_test->method (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + child_poa->deactivate_object (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Wait for the Object_Activator thread to exit. + thread_manager.wait (); + + root_poa->destroy (1, + 1 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsp b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsp new file mode 100644 index 00000000000..57bfd6222a0 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsp @@ -0,0 +1,204 @@ +# Microsoft Developer Studio Project File - Name="POA Nested_Non_Servant_Upcalls" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=POA Nested_Non_Servant_Upcalls - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Nested_Non_Servant_Upcalls.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Nested_Non_Servant_Upcalls.mak" CFG="POA Nested_Non_Servant_Upcalls - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "POA Nested_Non_Servant_Upcalls - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "POA Nested_Non_Servant_Upcalls - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "POA Nested_Non_Servant_Upcalls - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+
+!ELSEIF "$(CFG)" == "POA Nested_Non_Servant_Upcalls - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 aced.lib TAOd.lib TAO_PortableServerd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "POA Nested_Non_Servant_Upcalls - Win32 Release"
+# Name "POA Nested_Non_Servant_Upcalls - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Nested_Non_Servant_Upcalls.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\testC.cpp
+# ADD CPP /GR
+# End Source File
+# Begin Source File
+
+SOURCE=.\testS.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\testC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\testS.h
+# End Source File
+# End Group
+# Begin Group "IDL Files"
+
+# PROP Default_Filter "idl"
+# Begin Source File
+
+SOURCE=.\test.idl
+
+!IF "$(CFG)" == "POA Nested_Non_Servant_Upcalls - Win32 Release"
+
+USERDEP__TEST_="..\..\..\..\bin\Release\tao_idl.exe"
+# Begin Custom Build - Invoking TAO's IDL Compiler on $(InputPath)
+InputPath=.\test.idl
+InputName=test
+
+BuildCmds= \
+ ..\..\..\..\bin\Release\tao_idl -Ge 1 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "POA Nested_Non_Servant_Upcalls - Win32 Debug"
+
+USERDEP__TEST_="..\..\..\..\bin\tao_idl.exe"
+# Begin Custom Build - Invoking TAO's IDL Compiler on $(InputPath)
+InputPath=.\test.idl
+InputName=test
+
+BuildCmds= \
+ ..\..\..\..\bin\tao_idl -Ge 1 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsw b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsw new file mode 100644 index 00000000000..282c43ed9c0 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.dsw @@ -0,0 +1,28 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Nested_Non_Servant_Upcalls"=.\Nested_Non_Servant_Upcalls.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.mpc b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.mpc new file mode 100644 index 00000000000..de8665dd42a --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/Nested_Non_Servant_Upcalls.mpc @@ -0,0 +1,3 @@ +project(Nested Non Servant Upcalls): server { + exename = Nested_Non_Servant_Upcalls +} diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/makefile.bor b/TAO/tests/POA/Nested_Non_Servant_Upcalls/makefile.bor new file mode 100644 index 00000000000..9300ef71000 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/makefile.bor @@ -0,0 +1,27 @@ + +# +# Makefile for building the POA Nested_Non_Servant_Upcalls test +# + +NAME = Nested_Non_Servant_Upcalls + +OBJFILES = \ + $(OBJDIR)\testC.obj \ + $(OBJDIR)\testS.obj \ + $(OBJDIR)\Nested_Non_Servant_Upcalls.obj + +IDLFILES = \ + $(IDLDIR)\test.idl + +CPPDIR = .;.. + +IDLDIR = . + +!include <$(ACE_ROOT)\include\makeinclude\build_example.bor> + +# +# IDL Build rules +# + +$(IDLDIR)\testC.cpp $(IDLDIR)\testS.cpp: $(IDLDIR)\test.idl + $(TAO_IDL) $** diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/run_test.pl b/TAO/tests/POA/Nested_Non_Servant_Upcalls/run_test.pl new file mode 100755 index 00000000000..0a7a2dc6041 --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/run_test.pl @@ -0,0 +1,20 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib '../../../../bin'; +use PerlACE::Run_Test; + +$T = new PerlACE::Process("Nested_Non_Servant_Upcalls"); + +$test = $T->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + exit 1; +} + +exit 0; diff --git a/TAO/tests/POA/Nested_Non_Servant_Upcalls/test.idl b/TAO/tests/POA/Nested_Non_Servant_Upcalls/test.idl new file mode 100644 index 00000000000..dd1b063b9bf --- /dev/null +++ b/TAO/tests/POA/Nested_Non_Servant_Upcalls/test.idl @@ -0,0 +1,6 @@ +// $Id$ + +interface test +{ + void method (); +}; diff --git a/TAO/tests/POA/README b/TAO/tests/POA/README index 3ff2c499975..a62f8269c50 100644 --- a/TAO/tests/POA/README +++ b/TAO/tests/POA/README @@ -76,3 +76,8 @@ Object Adapter (POA) interfaces and their usage scenarios. This program tests that multiple calls to the Servant Locator can take place simultaneously. + . Nested_Non_Servant_Upcalls + + This program tests that nested non-servant upcalls are + handled correctly. + diff --git a/TAO/tests/RTCORBA/Banded_Connections/client.cpp b/TAO/tests/RTCORBA/Banded_Connections/client.cpp index d772f9652a6..099b9f0427d 100644 --- a/TAO/tests/RTCORBA/Banded_Connections/client.cpp +++ b/TAO/tests/RTCORBA/Banded_Connections/client.cpp @@ -2,7 +2,9 @@ #include "testC.h" #include "ace/Get_Opt.h" +#include "ace/Task.h" #include "tao/RTCORBA/RTCORBA.h" +#include "tao/ORB_Core.h" #include "../check_supported_priorities.cpp" // Default IOR files. @@ -101,34 +103,35 @@ invocation_exception_test (Test_ptr obj, ACE_CHECK; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // Initialize ORB. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +public: - // Parse arguments. - int result = - parse_args (argc, - argv); - if (result != 0) - return result; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in ()); + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { // Get the RTORB. CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = @@ -138,8 +141,8 @@ main (int argc, char *argv[]) // Get the RTCurrent. object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -149,8 +152,8 @@ main (int argc, char *argv[]) // Test object 1 (with CLIENT_PROPAGATED priority model). object = - orb->string_to_object (ior1 - ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior1 + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test_var client_propagated_obj = @@ -158,8 +161,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; // Test object 2 (with SERVER_DECLARED priority model). - object = orb->string_to_object (ior2 - ACE_ENV_ARG_PARAMETER); + object = this->orb_->string_to_object (ior2 + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test_var server_declared_obj = @@ -302,8 +305,67 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception in Banded_Connections test client:"); - return 1; + "Unexpected exception in Banded_Connections test client:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Initialize ORB. + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + "" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Parse arguments. + int result = + parse_args (argc, + argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + ACE_ASSERT (result != -1); + ACE_UNUSED_ARG (result); + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Unexpected exception in Banded_Connections test client:"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl index d3c896c28e3..aaab606acd8 100755 --- a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl +++ b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl @@ -47,7 +47,6 @@ if (PerlACE::waitforfile_timed ($iorfile2, 10) == -1) $server = $SV->TimedWait (1); if ($server == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/Banded_Connections/server.conf b/TAO/tests/RTCORBA/Banded_Connections/server.conf deleted file mode 100644 index 8100e1d8dd3..00000000000 --- a/TAO/tests/RTCORBA/Banded_Connections/server.conf +++ /dev/null @@ -1,4 +0,0 @@ -# $Id$ -# -static Advanced_Resource_Factory "-ORBReactorType tp -ORBReactorRegistry per-priority" - diff --git a/TAO/tests/RTCORBA/Banded_Connections/server.conf.xml b/TAO/tests/RTCORBA/Banded_Connections/server.conf.xml deleted file mode 100644 index b787d8faf9a..00000000000 --- a/TAO/tests/RTCORBA/Banded_Connections/server.conf.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Banded_Connections/server.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- $Id$ --> - <!-- --> - <static id="Advanced_Resource_Factory" params="-ORBReactorType tp -ORBReactorRegistry per-priority"/> -</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Banded_Connections/server.cpp b/TAO/tests/RTCORBA/Banded_Connections/server.cpp index 42a062ebb7d..792505fd819 100644 --- a/TAO/tests/RTCORBA/Banded_Connections/server.cpp +++ b/TAO/tests/RTCORBA/Banded_Connections/server.cpp @@ -117,7 +117,7 @@ Test_i::test_method (CORBA::Boolean client_propagated, void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); @@ -365,7 +365,7 @@ main (int argc, char *argv[]) // Make sure we can support multiple priorities that are required // for this test. - check_supported_priorities (orb.in()); + check_supported_priorities (orb.in ()); // Get the RTORB. CORBA::Object_var object = @@ -592,8 +592,8 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Banded_Connections test server:"); - return 1; + "Unexpected exception caught in Banded_Connections test server:"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Banded_Connections/svc.conf b/TAO/tests/RTCORBA/Banded_Connections/svc.conf index 37973382e2c..2154375e265 100644 --- a/TAO/tests/RTCORBA/Banded_Connections/svc.conf +++ b/TAO/tests/RTCORBA/Banded_Connections/svc.conf @@ -1,2 +1,4 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" +# No options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Banded_Connections/svc.conf.xml b/TAO/tests/RTCORBA/Banded_Connections/svc.conf.xml new file mode 100644 index 00000000000..b589f90605b --- /dev/null +++ b/TAO/tests/RTCORBA/Banded_Connections/svc.conf.xml @@ -0,0 +1,7 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- No options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Client_Propagated/client.cpp b/TAO/tests/RTCORBA/Client_Propagated/client.cpp index d4ee23f0a5d..c0915ef885d 100644 --- a/TAO/tests/RTCORBA/Client_Propagated/client.cpp +++ b/TAO/tests/RTCORBA/Client_Propagated/client.cpp @@ -1,6 +1,8 @@ // $Id$ #include "testC.h" +#include "ace/Task.h" +#include "tao/ORB_Core.h" #include "Client_ORBInitializer.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTCORBA/Priority_Mapping_Manager.h" @@ -34,39 +36,33 @@ parse_args (int argc, char *argv[]) return 0; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // Register the interceptors to check for the RTCORBA - // service contexts in the reply messages. - PortableInterceptor::ORBInitializer_ptr temp_initializer; +public: - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + int svc (void); - // Initialize and obtain reference to the Test object. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::ORB_var orb_; - if (parse_args (argc, argv) != 0) - return 1; +}; - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test_var server = @@ -78,7 +74,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Object reference <%s> is nil\n", ior), - 1); + -1); } // Check that the object is configured with CLIENT_PROPAGATED @@ -95,7 +91,7 @@ main (int argc, char *argv[]) if (CORBA::is_nil (priority_policy.in ())) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Priority Model Policy not exposed!\n"), - 1); + -1); RTCORBA::PriorityModel priority_model = priority_policy->priority_model (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -105,32 +101,35 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: priority_model != " "RTCORBA::CLIENT_PROPAGATED!\n"), - 1); + -1); // Make several invocation, changing the priority of this thread // for each. object = - orb->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = RTCORBA::Current::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - object = orb->resolve_initial_references ("PriorityMappingManager" - ACE_ENV_ARG_PARAMETER); + object = this->orb_->resolve_initial_references ("PriorityMappingManager" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::PriorityMappingManager_var mapping_manager = RTCORBA::PriorityMappingManager::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::PriorityMapping *pm = mapping_manager->mapping (); + int sched_policy = + this->orb_->orb_core ()->orb_params ()->ace_sched_policy (); + int max_priority = - ACE_Sched_Params::priority_max (ACE_SCHED_FIFO); + ACE_Sched_Params::priority_max (sched_policy); int min_priority = - ACE_Sched_Params::priority_min (ACE_SCHED_FIFO); + ACE_Sched_Params::priority_min (sched_policy); CORBA::Short native_priority = (max_priority + min_priority) / 2; @@ -141,7 +140,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "Cannot convert native priority %d to corba priority\n", native_priority), - 1); + -1); for (int i = 0; i < 3; ++i) { @@ -156,7 +155,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Unable to set thread " "priority to %d\n", desired_priority), - 1); + -1); server->test_method (priority ACE_ENV_ARG_PARAMETER); @@ -174,13 +173,92 @@ main (int argc, char *argv[]) ACE_PRINT_EXCEPTION(ex, "Most likely, this is due to the in-ability " "to set the thread priority."); - return 1; + return -1; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Caught exception:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Register the interceptors to check for the RTCORBA + // service contexts in the reply messages. + PortableInterceptor::ORBInitializer_ptr temp_initializer; + + ACE_NEW_RETURN (temp_initializer, + Client_ORBInitializer, + -1); // No exceptions yet! + PortableInterceptor::ORBInitializer_var initializer = + temp_initializer; + + PortableInterceptor::register_orb_initializer (initializer.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Initialize and obtain reference to the Test object. + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return -1; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:"); - return 1; + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Client_Propagated/run_test.pl b/TAO/tests/RTCORBA/Client_Propagated/run_test.pl index 89c87f58962..e6742be8d8e 100755 --- a/TAO/tests/RTCORBA/Client_Propagated/run_test.pl +++ b/TAO/tests/RTCORBA/Client_Propagated/run_test.pl @@ -26,7 +26,6 @@ if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) $server = $SV->TimedWait (1); if ($server == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/Client_Propagated/server.cpp b/TAO/tests/RTCORBA/Client_Propagated/server.cpp index 74cf16df245..100c213843f 100644 --- a/TAO/tests/RTCORBA/Client_Propagated/server.cpp +++ b/TAO/tests/RTCORBA/Client_Propagated/server.cpp @@ -2,6 +2,8 @@ #include "testS.h" #include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "tao/ORB_Core.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "../check_supported_priorities.cpp" @@ -70,7 +72,7 @@ Test_i::test_method (CORBA::Short priority void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -106,27 +108,33 @@ parse_args (int argc, char *argv[]) return 0; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // Standard initialization: - // parse arguments and get all the references (ORB, - // RootPOA, RTORB, RTCurrent, POAManager). - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +public: - if (parse_args (argc, argv) != 0) - return 1; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { CORBA::Object_var object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = @@ -142,14 +150,14 @@ main (int argc, char *argv[]) root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - object = orb->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); + object = this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = RTCORBA::Current::_narrow (object.in () ACE_ENV_ARG_PARAMETER); @@ -171,8 +179,8 @@ main (int argc, char *argv[]) poa_policy_list ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - Test_i server_impl (orb.in ()); + + Test_i server_impl (this->orb_.in ()); PortableServer::ObjectId_var id = child_poa->activate_object (&server_impl ACE_ENV_ARG_PARAMETER); @@ -185,7 +193,7 @@ main (int argc, char *argv[]) // Print Object IOR. CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); + this->orb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n\n", ior.in ())); @@ -197,7 +205,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output file for writing IOR: %s", ior_output_file), - 1); + -1); ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); } @@ -211,7 +219,7 @@ main (int argc, char *argv[]) poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Server ORB event loop finished\n")); @@ -237,10 +245,75 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; } ACE_ENDTRY; return 0; } +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Standard initialization: + // parse arguments and get all the references (ORB, + // RootPOA, RTORB, RTCurrent, POAManager). + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return -1; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/RTCORBA/Client_Propagated/svc.conf b/TAO/tests/RTCORBA/Client_Propagated/svc.conf index 37973382e2c..2154375e265 100644 --- a/TAO/tests/RTCORBA/Client_Propagated/svc.conf +++ b/TAO/tests/RTCORBA/Client_Propagated/svc.conf @@ -1,2 +1,4 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" +# No options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Client_Propagated/svc.conf.xml b/TAO/tests/RTCORBA/Client_Propagated/svc.conf.xml new file mode 100644 index 00000000000..b589f90605b --- /dev/null +++ b/TAO/tests/RTCORBA/Client_Propagated/svc.conf.xml @@ -0,0 +1,7 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- No options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Client_Protocol/client.cpp b/TAO/tests/RTCORBA/Client_Protocol/client.cpp index ba874cb4f0e..675aea8dd15 100644 --- a/TAO/tests/RTCORBA/Client_Protocol/client.cpp +++ b/TAO/tests/RTCORBA/Client_Protocol/client.cpp @@ -70,7 +70,7 @@ exception_test (Test_ptr server, { server->test_method (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - } + } ACE_CATCH (CORBA::INV_POLICY, ex) { ACE_DEBUG ((LM_DEBUG, @@ -99,7 +99,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; + return -1; // RTORB. CORBA::Object_var object = @@ -109,7 +109,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // PolicyManager. object = orb->resolve_initial_references ("ORBPolicyManager" @@ -120,7 +120,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (check_for_nil (policy_manager.in (), "PolicyManager") == -1) - return 1; + return -1; // PolicyCurrent. object = orb->resolve_initial_references ("PolicyCurrent" @@ -131,7 +131,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (check_for_nil (policy_current.in (), "PolicyCurrent") == -1) - return 1; + return -1; // Test object 1 (ClientProtocolPolicy set on server). object = orb->string_to_object (ior1 ACE_ENV_ARG_PARAMETER); @@ -139,7 +139,7 @@ main (int argc, char *argv[]) Test_var server1 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server1.in (), "server1") == -1) - return 1; + return -1; // Test object 2 (no client-exposed ClientProtocolPolicy). object = orb->string_to_object (ior2 ACE_ENV_ARG_PARAMETER); @@ -147,7 +147,7 @@ main (int argc, char *argv[]) Test_var server2 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server2.in (), "server2") == -1) - return 1; + return -1; // Do testing. @@ -259,8 +259,8 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in ClientProtocolPolicy test client:"); - return 1; + "Unexpected exception caught in ClientProtocolPolicy test client:"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Client_Protocol/server.cpp b/TAO/tests/RTCORBA/Client_Protocol/server.cpp index be63dbe15e2..09e5222b5ae 100644 --- a/TAO/tests/RTCORBA/Client_Protocol/server.cpp +++ b/TAO/tests/RTCORBA/Client_Protocol/server.cpp @@ -42,10 +42,10 @@ Test_i::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAM void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Shutting down \n")); + "(%P|%t) Shutting down \n")); this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -162,7 +162,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; + return -1; // RTORB. CORBA::Object_var object = @@ -172,7 +172,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // RootPOA. object = @@ -182,7 +182,7 @@ main (int argc, char *argv[]) PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; + return -1; // POAManager. PortableServer::POAManager_var poa_manager = @@ -224,7 +224,7 @@ main (int argc, char *argv[]) ior_output_file1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Create object 2. ACE_DEBUG ((LM_DEBUG, "\nActivated object two as ")); @@ -232,7 +232,7 @@ main (int argc, char *argv[]) ior_output_file2 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Run ORB Event loop. poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -246,8 +246,8 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in ClientProtocolPolicy: test server"); - return 1; + "Unexpected exception caught in ClientProtocolPolicy: test server"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Client_Protocol/svc.conf b/TAO/tests/RTCORBA/Client_Protocol/svc.conf index 55ad1bf0431..16b29a6e009 100644 --- a/TAO/tests/RTCORBA/Client_Protocol/svc.conf +++ b/TAO/tests/RTCORBA/Client_Protocol/svc.conf @@ -1,5 +1,3 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" + diff --git a/TAO/tests/RTCORBA/Client_Protocol/svc.conf.xml b/TAO/tests/RTCORBA/Client_Protocol/svc.conf.xml index 1ff4e0fd525..0c3f02e1362 100644 --- a/TAO/tests/RTCORBA/Client_Protocol/svc.conf.xml +++ b/TAO/tests/RTCORBA/Client_Protocol/svc.conf.xml @@ -1,8 +1,6 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Client_Protocol/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Collocation/Collocation.cpp b/TAO/tests/RTCORBA/Collocation/Collocation.cpp index 7e76ae823f0..630e2607318 100644 --- a/TAO/tests/RTCORBA/Collocation/Collocation.cpp +++ b/TAO/tests/RTCORBA/Collocation/Collocation.cpp @@ -2,6 +2,7 @@ #include "ace/Get_Opt.h" #include "ace/Array_Base.h" +#include "ace/Task.h" #include "tao/ORB_Core.h" #include "tao/RTCORBA/Thread_Pool.h" #include "testS.h" @@ -270,37 +271,37 @@ test_i::thread_info (const char *method_name) this->orb_->orb_core ()->get_tss_resources (); /// Get the lane attribute in TSS. - TAO_Thread_Lane *lane = - (TAO_Thread_Lane *) tss->lane_; - - if (lane) - { - ACE_DEBUG ((LM_DEBUG, - "(%t) %s (pool = %d; lane = %d); priority = %d (should be %d)\n", - method_name, - lane->pool ().id (), - lane->id (), - this->current_->the_priority (), - this->invocation_priority ())); - - ACE_ASSERT (this->pool_ == lane->pool ().id ()); - ACE_ASSERT (this->lane_ == lane->id ()); - ACE_ASSERT (this->current_->the_priority () == - this->invocation_priority ()); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "(%t) %s (default thread pool); priority = %d (should be %d)\n", - method_name, - this->current_->the_priority (), - this->invocation_priority ())); - - ACE_ASSERT (this->pool_ == 0); - ACE_ASSERT (this->lane_ == 0); - ACE_ASSERT (this->current_->the_priority () == - this->invocation_priority ()); - } + TAO_Thread_Lane *lane = + (TAO_Thread_Lane *) tss->lane_; + + if (lane) + { + ACE_DEBUG ((LM_DEBUG, + "(%t) %s (pool = %d; lane = %d); priority = %d (should be %d)\n", + method_name, + lane->pool ().id (), + lane->id (), + this->current_->the_priority (), + this->invocation_priority ())); + + ACE_ASSERT (this->pool_ == lane->pool ().id ()); + ACE_ASSERT (this->lane_ == lane->id ()); + ACE_ASSERT (this->current_->the_priority () == + this->invocation_priority ()); + } + else + { + ACE_DEBUG ((LM_DEBUG, + "(%t) %s (default thread pool); priority = %d (should be %d)\n", + method_name, + this->current_->the_priority (), + this->invocation_priority ())); + + ACE_ASSERT (this->pool_ == 0); + ACE_ASSERT (this->lane_ == 0); + ACE_ASSERT (this->current_->the_priority () == + this->invocation_priority ()); + } } void @@ -356,26 +357,25 @@ setup_test_parameters (Test_Object_And_Servant *test, orb->orb_core ()->get_tss_resources (); /// Get the lane attribute in TSS. - TAO_Thread_Lane *lane = - (TAO_Thread_Lane *) tss->lane_; - - if (lane) - { - test->servant_->invocation_pool_and_lane (lane->pool ().id (), - lane->id ()); - } - else - { - test->servant_->invocation_pool_and_lane (0, 0); - } + TAO_Thread_Lane *lane = + (TAO_Thread_Lane *) tss->lane_; + + if (lane) + { + test->servant_->invocation_pool_and_lane (lane->pool ().id (), + lane->id ()); + } + else + { + test->servant_->invocation_pool_and_lane (0, 0); + } } } class Server { public: - Server (int argc, - char *argv[] + Server (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL); void create_servant_in_root_poa (ACE_ENV_SINGLE_ARG_DECL); @@ -407,10 +407,10 @@ public: CORBA::ULong max_request_buffer_size_; }; -Server::Server (int argc, - char *argv[] +Server::Server (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) - : stacksize_ (0), + : orb_ (CORBA::ORB::_duplicate (orb)), + stacksize_ (0), static_threads_ (1), dynamic_threads_ (0), allow_request_buffering_ (0), @@ -418,17 +418,6 @@ Server::Server (int argc, max_buffered_requests_ (0), max_request_buffer_size_ (0) { - this->orb_ = - CORBA::ORB_init (argc, - argv, - "" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (this->orb_.in ()); - CORBA::Object_var object = this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); @@ -471,7 +460,6 @@ Server::Server (int argc, ACE_CHECK; } - void Server::create_servant_in_root_poa (ACE_ENV_SINGLE_ARG_DECL) { @@ -851,13 +839,32 @@ Server::shutdown (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char *argv[]) +Task::svc (void) { ACE_TRY_NEW_ENV { - Server server (argc, - argv + Server server (this->orb_.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -902,7 +909,71 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + "" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Make sure we can support multiple priorities that are + // required for this test. + check_supported_priorities (orb.in ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Exception caught:"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Collocation/run_test.pl b/TAO/tests/RTCORBA/Collocation/run_test.pl index f0066709b8b..7ea04278c24 100755 --- a/TAO/tests/RTCORBA/Collocation/run_test.pl +++ b/TAO/tests/RTCORBA/Collocation/run_test.pl @@ -14,7 +14,6 @@ $T = new PerlACE::Process ("Collocation"); $test = $T->SpawnWaitKill(60); if ($test == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $T->{RUNNING} = 0; } else { diff --git a/TAO/tests/RTCORBA/Collocation/svc.conf b/TAO/tests/RTCORBA/Collocation/svc.conf index 37973382e2c..2154375e265 100644 --- a/TAO/tests/RTCORBA/Collocation/svc.conf +++ b/TAO/tests/RTCORBA/Collocation/svc.conf @@ -1,2 +1,4 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" +# No options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Collocation/svc.conf.xml b/TAO/tests/RTCORBA/Collocation/svc.conf.xml new file mode 100644 index 00000000000..b589f90605b --- /dev/null +++ b/TAO/tests/RTCORBA/Collocation/svc.conf.xml @@ -0,0 +1,7 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- No options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Destroy_Thread_Pool/Destroy_Thread_Pool.cpp b/TAO/tests/RTCORBA/Destroy_Thread_Pool/Destroy_Thread_Pool.cpp index 338137917d7..ddb5db83be5 100644 --- a/TAO/tests/RTCORBA/Destroy_Thread_Pool/Destroy_Thread_Pool.cpp +++ b/TAO/tests/RTCORBA/Destroy_Thread_Pool/Destroy_Thread_Pool.cpp @@ -3,7 +3,6 @@ #include "ace/Get_Opt.h" #include "tao/corba.h" #include "tao/RTCORBA/RTCORBA.h" -#include "../check_supported_priorities.cpp" ACE_RCSID(Destroy_Thread_Pools, Destroy_Thread_Pools, "$Id$") @@ -100,10 +99,6 @@ main (int argc, char *argv[]) "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); CORBA::Object_var object = orb->resolve_initial_references ("RTORB" @@ -165,7 +160,7 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Destroy_Thread_Pool/svc.conf b/TAO/tests/RTCORBA/Destroy_Thread_Pool/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/Destroy_Thread_Pool/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Diffserv/client.cpp b/TAO/tests/RTCORBA/Diffserv/client.cpp index 4ddaa9e5e21..e5e65738b1b 100644 --- a/TAO/tests/RTCORBA/Diffserv/client.cpp +++ b/TAO/tests/RTCORBA/Diffserv/client.cpp @@ -26,100 +26,100 @@ check_for_nil (CORBA::Object_ptr obj, const char *msg) } enum -{ - OBJECT, - THREAD, - ORB -}; + { + OBJECT, + THREAD, + ORB + }; void change_network_priority (int enable_network_priority, - int level, - Test_var &server, - CORBA::ORB_ptr orb) + int level, + Test_var &server, + CORBA::ORB_ptr orb) { ACE_TRY_NEW_ENV { CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = - RTCORBA::RTORB::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + RTCORBA::RTORB::_narrow (object.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (check_for_nil (rt_orb.in (), "RTORB") == -1) - ACE_ERROR ((LM_ERROR, - "RTORB is nil\n")); - + ACE_ERROR ((LM_ERROR, + "RTORB is nil\n")); + //Set the tcp protocol protperties RTCORBA::TCPProtocolProperties_var tcp_properties = - rt_orb->create_tcp_protocol_properties (ACE_DEFAULT_MAX_SOCKET_BUFSIZ, - ACE_DEFAULT_MAX_SOCKET_BUFSIZ, - 1, - 0, - 1, - enable_network_priority - ACE_ENV_ARG_PARAMETER); + rt_orb->create_tcp_protocol_properties (ACE_DEFAULT_MAX_SOCKET_BUFSIZ, + ACE_DEFAULT_MAX_SOCKET_BUFSIZ, + 1, + 0, + 1, + enable_network_priority + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + RTCORBA::ProtocolList protocols; protocols.length (1); protocols[0].protocol_type = 0; protocols[0].transport_protocol_properties = - RTCORBA::ProtocolProperties::_duplicate (tcp_properties.in ()); + RTCORBA::ProtocolProperties::_duplicate (tcp_properties.in ()); protocols[0].orb_protocol_properties = - RTCORBA::ProtocolProperties::_nil (); - + RTCORBA::ProtocolProperties::_nil (); + CORBA::PolicyList policy_list; policy_list.length (1); policy_list[0] = - rt_orb->create_client_protocol_policy (protocols - ACE_ENV_ARG_PARAMETER); + rt_orb->create_client_protocol_policy (protocols + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - + + switch (level) - { - //Change policy at ORB level - case ORB: - { - // PolicyManager. - object = orb->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - CORBA::PolicyManager_var policy_manager = - CORBA::PolicyManager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - policy_manager->set_policy_overrides (policy_list, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - - ACE_TRY_CHECK; - break; - } - //Change policy at THREAD level - case THREAD: - orb->orb_core ()->policy_current ().set_policy_overrides (policy_list, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - - ACE_TRY_CHECK; - break; - //Change policy at OBJECT level - case OBJECT: - { - CORBA::Object_var object = server->_set_policy_overrides (policy_list, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - server = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - break; - } - }; - + { + //Change policy at ORB level + case ORB: + { + // PolicyManager. + object = orb->resolve_initial_references ("ORBPolicyManager" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + CORBA::PolicyManager_var policy_manager = + CORBA::PolicyManager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + policy_manager->set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE + ACE_ENV_ARG_PARAMETER); + + ACE_TRY_CHECK; + break; + } + //Change policy at THREAD level + case THREAD: + orb->orb_core ()->policy_current ().set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE + ACE_ENV_ARG_PARAMETER); + + ACE_TRY_CHECK; + break; + //Change policy at OBJECT level + case OBJECT: + { + CORBA::Object_var object = server->_set_policy_overrides (policy_list, + CORBA::SET_OVERRIDE + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + server = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + break; + } + }; + } ACE_CATCHANY { @@ -144,26 +144,26 @@ parse_args (int argc, char *argv[]) ior = get_opts.opt_arg (); break; case 'n':// number of itarations - n = ACE_OS::atoi (get_opts.opt_arg ()); - break; + n = ACE_OS::atoi (get_opts.opt_arg ()); + break; case 'p':// desired priority - desired_priority = ACE_OS::atoi (get_opts.opt_arg ()); - break; + desired_priority = ACE_OS::atoi (get_opts.opt_arg ()); + break; case 'c': - ior = "file://test1.ior"; - break; + ior = "file://test1.ior"; + break; case 's': - ior = "file://test2.ior"; - break; + ior = "file://test2.ior"; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-k <ior> " - "-n <number_of_iterations>" - "-p <desired priority>" - "-s [test server setting dscp]" - "-c [test client setting dscp]" + "-n <number_of_iterations>" + "-p <desired priority>" + "-s [test server setting dscp]" + "-c [test client setting dscp]" "\n", argv [0]), -1); @@ -175,98 +175,96 @@ parse_args (int argc, char *argv[]) void toggle (int &i) { - if (i == 0) - i = 1; - else i = 0; + if (i == 0) + i = 1; + else i = 0; } int main (int argc, char *argv[]) { - - ACE_TRY_NEW_ENV { - + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (parse_args (argc, argv) != 0) - return 1; + return -1; // Initialize and obtain reference to the Test object. CORBA::Object_var client_object = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + Test_var server = Test::_narrow (client_object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (CORBA::is_nil (server.in ())) { ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Object reference <%s> is nil\n", ior), - 1); + -1); } - + //Resolve the Network priority Mapping Manager CORBA::Object_var object = orb->resolve_initial_references ("NetworkPriorityMappingManager" - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + RTCORBA::NetworkPriorityMappingManager_var mapping_manager = RTCORBA::NetworkPriorityMappingManager::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + // Initialize the custom priority mapping TAO_Custom_Network_Priority_Mapping *cnpm = 0; ACE_NEW_RETURN (cnpm, - TAO_Custom_Network_Priority_Mapping, - -1); - + TAO_Custom_Network_Priority_Mapping, + -1); + //Set the desired corba priority on the network mapping manager cnpm->desired_priority (desired_priority); - //Load the custom network priority mapping object in the network priority //mapping manager. The user can thus add his own priority mapping. + //Load the custom network priority mapping object in the network priority //mapping manager. The user can thus add his own priority mapping. mapping_manager->mapping (cnpm); ACE_DEBUG ((LM_DEBUG, - "Desired Priority = %d\n", - desired_priority)); - - int enp = 0; //enable_network_priority + "Desired Priority = %d\n", + desired_priority)); - // Make several invocation, + int enp = 0; //enable_network_priority + + // Make several invocation, for (int i = 0; i < n; ++i) { - switch (i) - { - case 0://Set - case 1://Unset - toggle (enp); - change_network_priority (enp, ORB, server ,orb.in ()); - break; - case 2://Set - case 3://Unset - toggle (enp); - change_network_priority (enp, THREAD, server, orb.in ()); - break; - case 4://Set - case 5://Unset - default: - toggle (enp); - change_network_priority (enp, OBJECT, server, orb.in ()); - break; - }; - + switch (i) + { + case 0://Set + case 1://Unset + toggle (enp); + change_network_priority (enp, ORB, server ,orb.in ()); + break; + case 2://Set + case 3://Unset + toggle (enp); + change_network_priority (enp, THREAD, server, orb.in ()); + break; + case 4://Set + case 5://Unset + default: + toggle (enp); + change_network_priority (enp, OBJECT, server, orb.in ()); + break; + }; + server->test_method (0 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - } + } // Shut down Server ORB. server->shutdown ();//(0 ACE_ENV_SINGLE_ARG_PARAMETER); @@ -277,17 +275,15 @@ main (int argc, char *argv[]) ACE_PRINT_EXCEPTION(ex, "Most likely, this is due to the in-ability " "to set the thread priority."); - return 1; + return -1; } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:"); - return 1; + return -1; } ACE_ENDTRY; return 0; } - - diff --git a/TAO/tests/RTCORBA/Diffserv/server.cpp b/TAO/tests/RTCORBA/Diffserv/server.cpp index 6080f533f30..307bd698dd5 100644 --- a/TAO/tests/RTCORBA/Diffserv/server.cpp +++ b/TAO/tests/RTCORBA/Diffserv/server.cpp @@ -66,13 +66,13 @@ Test_i::test_method (CORBA::Short priority if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "Servant thread priority: %d\n", - servant_thread_priority)); + "Servant thread priority: %d\n", + servant_thread_priority)); } void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -114,14 +114,14 @@ parse_args (int argc, char *argv[]) -1); break; case 's': - test_server = 1; - test_client = 0; - break; + test_server = 1; + test_client = 0; + break; case 'c': - test_client = 1; - test_server = 0; - break; + test_client = 1; + test_server = 0; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -129,8 +129,8 @@ parse_args (int argc, char *argv[]) "-k <iorfile1> " "-o <iorfile2> " "-p <poa_priority> " - "-s [test_server setting of dscp]" - "-c [test client setting of dscp]" + "-s [test_server setting of dscp]" + "-c [test client setting of dscp]" "\n", argv [0]), -1); @@ -163,7 +163,7 @@ create_object (RTPortableServer::POA_ptr poa, PortableServer::ObjectId_var id; id = poa->activate_object (server_impl ACE_ENV_ARG_PARAMETER); - + ACE_CHECK_RETURN (-1); CORBA::Object_var server = @@ -210,7 +210,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; + return -1; // RTORB. CORBA::Object_var object = @@ -220,7 +220,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // RootPOA. object = @@ -230,8 +230,8 @@ main (int argc, char *argv[]) PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; - + return -1; + // POAManager. PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -245,114 +245,114 @@ main (int argc, char *argv[]) int result; if (test_client) - { - poa_policy_list.length (1); - - poa_policy_list[0] = - root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - //Create POA without Diffserv enabled - PortableServer::POA_var poa_without_ds = - root_poa->create_POA ("POA_WITHOUT_DS", - poa_manager.in (), - poa_policy_list - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - RTPortableServer::POA_var rt_poa_without_ds = - RTPortableServer::POA::_narrow (poa_without_ds.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (check_for_nil (poa_without_ds.in (), "RTPOA") == -1) - return 1; - - // Create object 1 - ACE_DEBUG ((LM_DEBUG, "\nActivated object two as ")); - result = create_object (rt_poa_without_ds.in (), orb.in (), &server_impl, - ior_output_file1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (result == -1) - return 1; - } + { + poa_policy_list.length (1); + + poa_policy_list[0] = + root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + //Create POA without Diffserv enabled + PortableServer::POA_var poa_without_ds = + root_poa->create_POA ("POA_WITHOUT_DS", + poa_manager.in (), + poa_policy_list + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + RTPortableServer::POA_var rt_poa_without_ds = + RTPortableServer::POA::_narrow (poa_without_ds.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (check_for_nil (poa_without_ds.in (), "RTPOA") == -1) + return -1; + + // Create object 1 + ACE_DEBUG ((LM_DEBUG, "\nActivated object two as ")); + result = create_object (rt_poa_without_ds.in (), orb.in (), &server_impl, + ior_output_file1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (result == -1) + return -1; + } else if (test_server) - { - poa_policy_list.length (1); - poa_policy_list[0] = - rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - object = orb->resolve_initial_references ("NetworkPriorityMappingManager" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - RTCORBA::NetworkPriorityMappingManager_var mapping_manager = - RTCORBA::NetworkPriorityMappingManager::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - TAO_Custom_Network_Priority_Mapping *cnpm = 0; - ACE_NEW_RETURN (cnpm, - TAO_Custom_Network_Priority_Mapping, - -1); - - cnpm->desired_priority (poa_priority); - - mapping_manager->mapping (cnpm); - - poa_policy_list.length (2); - - //Set transport protocol properties - RTCORBA::TCPProtocolProperties_var tcp_properties = - rt_orb->create_tcp_protocol_properties (ACE_DEFAULT_MAX_SOCKET_BUFSIZ, - ACE_DEFAULT_MAX_SOCKET_BUFSIZ, - 1, - 0, - 1, - 1 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - RTCORBA::ProtocolList protocols; - protocols.length (1); - protocols[0].protocol_type = 0; - protocols[0].transport_protocol_properties = - RTCORBA::ProtocolProperties::_duplicate (tcp_properties.in ()); - protocols[0].orb_protocol_properties = - RTCORBA::ProtocolProperties::_nil (); - - poa_policy_list[1] = - rt_orb->create_server_protocol_policy (protocols - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - //Create POA with Diffserv enabled - PortableServer::POA_var poa_with_ds = - root_poa->create_POA ("POA_WITH_DS", - poa_manager.in (), - poa_policy_list - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - RTPortableServer::POA_var rt_poa_with_ds = - RTPortableServer::POA::_narrow (poa_with_ds.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (check_for_nil (poa_with_ds.in (), "RTPOA") == -1) - return 1; - - // Create object 2 (it will inherit POA's priority). - ACE_DEBUG ((LM_DEBUG, "\nActivated object one as ")); - result = create_object (rt_poa_with_ds.in (), orb.in (), &server_impl, - ior_output_file2 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (result == -1) - return 1; - - - - } + { + poa_policy_list.length (1); + poa_policy_list[0] = + rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + object = orb->resolve_initial_references ("NetworkPriorityMappingManager" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + RTCORBA::NetworkPriorityMappingManager_var mapping_manager = + RTCORBA::NetworkPriorityMappingManager::_narrow (object.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + TAO_Custom_Network_Priority_Mapping *cnpm = 0; + ACE_NEW_RETURN (cnpm, + TAO_Custom_Network_Priority_Mapping, + -1); + + cnpm->desired_priority (poa_priority); + + mapping_manager->mapping (cnpm); + + poa_policy_list.length (2); + + //Set transport protocol properties + RTCORBA::TCPProtocolProperties_var tcp_properties = + rt_orb->create_tcp_protocol_properties (ACE_DEFAULT_MAX_SOCKET_BUFSIZ, + ACE_DEFAULT_MAX_SOCKET_BUFSIZ, + 1, + 0, + 1, + 1 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + RTCORBA::ProtocolList protocols; + protocols.length (1); + protocols[0].protocol_type = 0; + protocols[0].transport_protocol_properties = + RTCORBA::ProtocolProperties::_duplicate (tcp_properties.in ()); + protocols[0].orb_protocol_properties = + RTCORBA::ProtocolProperties::_nil (); + + poa_policy_list[1] = + rt_orb->create_server_protocol_policy (protocols + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + //Create POA with Diffserv enabled + PortableServer::POA_var poa_with_ds = + root_poa->create_POA ("POA_WITH_DS", + poa_manager.in (), + poa_policy_list + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + RTPortableServer::POA_var rt_poa_with_ds = + RTPortableServer::POA::_narrow (poa_with_ds.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (check_for_nil (poa_with_ds.in (), "RTPOA") == -1) + return -1; + + // Create object 2 (it will inherit POA's priority). + ACE_DEBUG ((LM_DEBUG, "\nActivated object one as ")); + result = create_object (rt_poa_with_ds.in (), orb.in (), &server_impl, + ior_output_file2 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (result == -1) + return -1; + + + + } // Activate POA manager. poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -367,13 +367,10 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Server_Declared test server:"); - return 1; + "Unexpected exception caught in Server_Declared test server:"); + return -1; } ACE_ENDTRY; return 0; } - - - diff --git a/TAO/tests/RTCORBA/Explicit_Binding/client.cpp b/TAO/tests/RTCORBA/Explicit_Binding/client.cpp index 6afe1ccee94..c3d9a5d3785 100644 --- a/TAO/tests/RTCORBA/Explicit_Binding/client.cpp +++ b/TAO/tests/RTCORBA/Explicit_Binding/client.cpp @@ -5,7 +5,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/RTCORBA/RTCORBA.h" -#include "../check_supported_priorities.cpp" const char *ior = "file://test.ior"; @@ -60,11 +59,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // RTORB. CORBA::Object_var object = @@ -74,7 +69,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // PolicyCurrent. object = orb->resolve_initial_references ("PolicyCurrent" @@ -85,7 +80,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (check_for_nil (policy_current.in (), "PolicyCurrent") == -1) - return 1; + return -1; // Test object. object = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); @@ -93,7 +88,7 @@ main (int argc, char *argv[]) Test_var server = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server.in (), "server") == -1) - return 1; + return -1; // Test 1: Check that <validate_connection> establishes an // appropriate connection for the current set of effective @@ -130,8 +125,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (!status) - ACE_DEBUG ((LM_DEBUG, - "ERROR: <validate_connection> returned FALSE\n")); + ACE_DEBUG ((LM_DEBUG, + "ERROR: <validate_connection> returned FALSE\n")); // Test 2: Check that connection established with // <validate_connection> is used for subsequent invocations. @@ -168,25 +163,25 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (status) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("<validate_connection> returned TRUE\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("<validate_connection> returned TRUE\n"))); // // This portion of code has been temporarily disabled. // - /* - - if (pols.ptr () != 0 - && pols->length () == 1 - && pols[0u]->policy_type () == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE) + /* + if (pols.ptr () != 0 + && pols->length () == 1 + && pols[0u]->policy_type () == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE) ACE_DEBUG ((LM_DEBUG, - "Inconsistent policies contain " - "ClientProtocolPolicy, as expected.\n")); - else + "Inconsistent policies contain " + "ClientProtocolPolicy, as expected.\n")); + else ACE_DEBUG ((LM_DEBUG, - "ERROR: Inconsistent policies do not " - "contain what's expected.\n")); - */ + "ERROR: Inconsistent policies do not " + "contain what's expected.\n")); + */ + // Testing over. Shut down Server ORB. protocols[0].protocol_type = TAO_TAG_SHMEM_PROFILE; policy_list[0] = @@ -198,7 +193,7 @@ main (int argc, char *argv[]) CORBA::SET_OVERRIDE ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + ACE_DEBUG ((LM_DEBUG, "\n Testing over - shutting down\n")); ACE_OS::sleep (2); @@ -210,11 +205,10 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Explicit_Binding test client:"); - return 1; + "Unexpected exception caught in Explicit_Binding test client:"); + return -1; } ACE_ENDTRY; return 0; } - diff --git a/TAO/tests/RTCORBA/Explicit_Binding/server.cpp b/TAO/tests/RTCORBA/Explicit_Binding/server.cpp index 6147761533c..7c434d0c2e5 100644 --- a/TAO/tests/RTCORBA/Explicit_Binding/server.cpp +++ b/TAO/tests/RTCORBA/Explicit_Binding/server.cpp @@ -6,7 +6,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTPortableServer/RTPortableServer.h" -#include "../check_supported_priorities.cpp" class Test_i : public POA_Test { @@ -44,7 +43,7 @@ Test_i::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAM void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -145,11 +144,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // RootPOA. CORBA::Object_var object = @@ -159,7 +154,7 @@ main (int argc, char *argv[]) PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; + return -1; // POAManager. PortableServer::POAManager_var poa_manager = @@ -178,7 +173,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Run ORB Event loop. poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -192,11 +187,10 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Explicit_Binding test server:"); - return 1; + "Unexpected exception caught in Explicit_Binding test server:"); + return -1; } ACE_ENDTRY; return 0; } - diff --git a/TAO/tests/RTCORBA/Explicit_Binding/svc.conf b/TAO/tests/RTCORBA/Explicit_Binding/svc.conf index 75b59c6d97a..57fc20f1023 100644 --- a/TAO/tests/RTCORBA/Explicit_Binding/svc.conf +++ b/TAO/tests/RTCORBA/Explicit_Binding/svc.conf @@ -1,6 +1,2 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" - -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO"
\ No newline at end of file diff --git a/TAO/tests/RTCORBA/Explicit_Binding/svc.conf.xml b/TAO/tests/RTCORBA/Explicit_Binding/svc.conf.xml index 8ef73639f29..0c3f02e1362 100644 --- a/TAO/tests/RTCORBA/Explicit_Binding/svc.conf.xml +++ b/TAO/tests/RTCORBA/Explicit_Binding/svc.conf.xml @@ -1,8 +1,6 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Explicit_Binding/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Linear_Priority/client.cpp b/TAO/tests/RTCORBA/Linear_Priority/client.cpp index a16684a7d4c..704f51513c1 100644 --- a/TAO/tests/RTCORBA/Linear_Priority/client.cpp +++ b/TAO/tests/RTCORBA/Linear_Priority/client.cpp @@ -71,7 +71,8 @@ parse_args (int argc, char **argv) class Worker_Thread : public ACE_Task_Base { public: - Worker_Thread (test_ptr test, + Worker_Thread (ACE_Thread_Manager &thread_manager, + test_ptr test, RTCORBA::Current_ptr current, CORBA::Short priority); @@ -85,10 +86,12 @@ private: CORBA::Short priority_; }; -Worker_Thread::Worker_Thread (test_ptr test, +Worker_Thread::Worker_Thread (ACE_Thread_Manager &thread_manager, + test_ptr test, RTCORBA::Current_ptr current, CORBA::Short priority) - : test_ (test::_duplicate (test)), + : ACE_Task_Base (&thread_manager), + test_ (test::_duplicate (test)), current_ (RTCORBA::Current::_duplicate (current)), priority_ (priority) { @@ -159,31 +162,34 @@ Worker_Thread::svc (void) return 0; } -int -main (int argc, char **argv) +class Task : public ACE_Task_Base { +public: - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - int result = - parse_args (argc, argv); - if (result != 0) - return result; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in ()); + int svc (void); + + CORBA::ORB_var orb_; +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = @@ -192,8 +198,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -206,8 +212,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("ORBPolicyManager" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::PolicyManager_var policy_manager = @@ -216,8 +222,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->string_to_object (ior - ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; test_var test = @@ -226,7 +232,7 @@ main (int argc, char **argv) ACE_TRY_CHECK; ULong_Array priorities; - result = + int result = get_values ("client", invocation_priorities_file, "invocation priorities", @@ -255,6 +261,9 @@ main (int argc, char **argv) u_long i = 0; + // Thread Manager for managing workers. + ACE_Thread_Manager thread_manager; + // Workers. Worker_Thread **workers = 0; @@ -267,7 +276,8 @@ main (int argc, char **argv) ++i) { ACE_NEW_RETURN (workers[i], - Worker_Thread (test.in (), + Worker_Thread (thread_manager, + test.in (), current.in (), priorities[i]), -1); @@ -275,8 +285,7 @@ main (int argc, char **argv) long flags = THR_NEW_LWP | THR_JOINABLE | - orb->orb_core ()->orb_params ()->scope_policy () | - orb->orb_core ()->orb_params ()->sched_policy (); + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); result = workers[i]->activate (flags); @@ -284,7 +293,7 @@ main (int argc, char **argv) return result; } - ACE_Thread_Manager::instance ()->wait (); + thread_manager.wait (); for (i = 0; i < priorities.size (); @@ -309,3 +318,71 @@ main (int argc, char **argv) return 0; } + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception!"); + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/RTCORBA/Linear_Priority/run_test.pl b/TAO/tests/RTCORBA/Linear_Priority/run_test.pl index 46a313258ab..564403b0c67 100755 --- a/TAO/tests/RTCORBA/Linear_Priority/run_test.pl +++ b/TAO/tests/RTCORBA/Linear_Priority/run_test.pl @@ -112,7 +112,6 @@ sub check_supported_priorities $process = shift; $returnVal = $process->TimedWait (1); if ($returnVal == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $process->{RUNNING} = 0; exit 0; diff --git a/TAO/tests/RTCORBA/Linear_Priority/server.cpp b/TAO/tests/RTCORBA/Linear_Priority/server.cpp index 4b6aa5268bf..b81a3dbbec2 100644 --- a/TAO/tests/RTCORBA/Linear_Priority/server.cpp +++ b/TAO/tests/RTCORBA/Linear_Priority/server.cpp @@ -1,6 +1,8 @@ // $Id$ #include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "tao/ORB_Core.h" #include "testS.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "../check_supported_priorities.cpp" @@ -138,25 +140,34 @@ write_iors_to_file (CORBA::Object_ptr object, ACE_OS::fclose (file); } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char **argv) +Task::svc (void) { ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in ()); - CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = @@ -164,14 +175,9 @@ main (int argc, char **argv) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - int result = - parse_args (argc, argv); - if (result != 0) - return result; - object = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RootPOA" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = @@ -185,7 +191,7 @@ main (int argc, char **argv) CORBA::PolicyList policies; - result = + int result = get_priority_bands ("server", bands_file, rt_orb.in (), @@ -243,7 +249,7 @@ main (int argc, char **argv) test_i *servant = 0; ACE_NEW_THROW_EX (servant, - test_i (orb.in (), + test_i (this->orb_.in (), poa.in ()), CORBA::NO_MEMORY ()); ACE_TRY_CHECK; @@ -255,7 +261,7 @@ main (int argc, char **argv) ACE_TRY_CHECK; write_iors_to_file (test.in (), - orb.in (), + this->orb_.in (), ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -263,11 +269,79 @@ main (int argc, char **argv) poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; + } + ACE_ENDTRY; + + return 0; +} - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); } ACE_CATCHANY { diff --git a/TAO/tests/RTCORBA/Linear_Priority/svc.conf b/TAO/tests/RTCORBA/Linear_Priority/svc.conf index 0d4878fae68..56e9a13fea0 100644 --- a/TAO/tests/RTCORBA/Linear_Priority/svc.conf +++ b/TAO/tests/RTCORBA/Linear_Priority/svc.conf @@ -1,5 +1,5 @@ -# Regular test -static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_RR" +# Options required for regular testing; comment out for real-time testing +static RT_ORB_Loader "-ORBPriorityMapping linear" -# For testing of RT threads -# static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_RR -ORBScopePolicy SYSTEM" +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Linear_Priority/svc.conf.xml b/TAO/tests/RTCORBA/Linear_Priority/svc.conf.xml index d334969a31f..b798a25865d 100644 --- a/TAO/tests/RTCORBA/Linear_Priority/svc.conf.xml +++ b/TAO/tests/RTCORBA/Linear_Priority/svc.conf.xml @@ -1,8 +1,8 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Linear_Priority/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- Regular test --> + <!-- Options required for regular testing --> <static id="RT_ORB_Loader" params="-ORBPriorityMapping linear"/> - <!-- For testing of RT threads --> - <!-- static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_RR -ORBScopePolicy SYSTEM" --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.conf b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.cpp b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.cpp index 055cbc5fb7f..a8cd4d4f9cd 100644 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.cpp +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/client.cpp @@ -5,6 +5,7 @@ #include "tao/RTCORBA/Priority_Mapping_Manager.h" #include "ace/Get_Opt.h" #include "ace/Task.h" +#include "tao/ORB_Core.h" #include "../check_supported_priorities.cpp" #include "tao/Strategies/advanced_resource.h" @@ -119,10 +120,10 @@ parse_args (int argc, char *argv[]) if (priority1 < 0 || priority2 < 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Valid thread priorities must be specified.\n" - "See README for command-line options.\n"), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + "Valid thread priorities must be specified.\n" + "See README for command-line options.\n"), + -1); return 0; } @@ -138,59 +139,64 @@ check_for_nil (CORBA::Object_ptr obj, const char *msg) return 0; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // Initialize the ORB, resolve references and parse arguments. +public: - // ORB. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // Parse arguments. - if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + int svc (void); + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { // Priority Mapping Manager. CORBA::Object_var object = - orb->resolve_initial_references ("PriorityMappingManager" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("PriorityMappingManager" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::PriorityMappingManager_var mapping_manager = RTCORBA::PriorityMappingManager::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (mapping_manager.in (), "Mapping Manager") == -1) - return 1; + return -1; RTCORBA::PriorityMapping *pm = mapping_manager->mapping (); // RTCurrent. object = - orb->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = RTCORBA::Current::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (current.in (), "RTCurrent") == -1) - return 1; + return -1; // Obtain Test object reference. object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test_var server = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server.in (), "Test object") == -1) - return 1; + return -1; // Check that test object is configured with CLIENT_PROPAGATED // PriorityModelPolicy. @@ -204,7 +210,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (check_for_nil (priority_policy.in (), "PriorityModelPolicy") == -1) - return 1; + return -1; RTCORBA::PriorityModel priority_model = priority_policy->priority_model (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -213,51 +219,54 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: priority_model != " "RTCORBA::CLIENT_PROPAGATED!\n"), - 1); + -1); // Spawn two worker threads. ACE_Barrier barrier (2); - int flags = THR_NEW_LWP|THR_JOINABLE|THR_BOUND; + int flags = + THR_NEW_LWP | + THR_JOINABLE | + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); // Worker 1. - Worker_Thread worker1 (orb.in (), + Worker_Thread worker1 (this->orb_.in (), server.in (), protocol1, &barrier); CORBA::Short native_priority1 = 0; if (pm->to_native (priority1, native_priority1) == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot convert corba priority %d to native priority\n", - priority1), - 1); + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot convert corba priority %d to native priority\n", + priority1), + -1); if (worker1.activate (flags, - 1, 1, + 1, 0, native_priority1) != 0) ACE_ERROR_RETURN ((LM_ERROR, "Cannot activate first client worker threads\n"), - 1); + -1); // Worker 2. - Worker_Thread worker2 (orb.in (), + Worker_Thread worker2 (this->orb_.in (), server.in (), protocol2, &barrier); CORBA::Short native_priority2 = 0; if (pm->to_native (priority2, native_priority2) == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot convert corba priority %d to native priority\n", - priority2), - 1); + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot convert corba priority %d to native priority\n", + priority2), + -1); if (worker2.activate (flags, - 1, 1, + 1, 0, native_priority2) != 0) ACE_ERROR_RETURN ((LM_ERROR, "Cannot activate second client worker threads\n"), - 1); + -1); // Wait for worker threads to finish. ACE_Thread_Manager::instance ()->wait (); @@ -272,13 +281,82 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception in MT_Client_Protocol_Priority test client:"); - return 1; + "Unexpected exception in MT_Client_Protocol_Priority test client:"); + return -1; } ACE_ENDTRY; return 0; } + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Initialize the ORB, resolve references and parse arguments. + + // ORB. + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Parse arguments. + if (parse_args (argc, argv) != 0) + return -1; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Unexpected exception in MT_Client_Protocol_Priority test client:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + // **************************************************************** Worker_Thread::Worker_Thread (CORBA::ORB_ptr orb, 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 1d888e6dd92..af580051506 100755 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl @@ -22,8 +22,8 @@ $data_file = PerlACE::LocalFile ("test_run.data"); $debug_level = 1; $iterations = 50; -$priority1 = 65; -$priority2 = 70; +$priority1 = 45; +$priority2 = 50; if ($^O eq "MSWin32") { $priority1 = 2; @@ -42,15 +42,12 @@ elsif ($^O eq "hpux") { unlink $iorfile; unlink $data_file; -$server_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext"); -$client_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext"); - $server_args = - "-o $iorfile -ORBdebuglevel $debug_level -ORBsvcconf $server_conf " + "-o $iorfile -ORBdebuglevel $debug_level " ."-ORBendpoint iiop:// -ORBendpoint shmiop:// "; $client_args = - "-ORBSvcConf $client_conf -o file://$iorfile " + "-o file://$iorfile " ."-a $priority1 -b $priority2 -e 1413566210 -f 0 -n $iterations"; $SV = new PerlACE::Process ("server", $server_args); @@ -85,7 +82,6 @@ if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) open (STDOUT, ">&OLDOUT"); open (STDERR, ">&OLDERR"); - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.conf b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.conf deleted file mode 100644 index 0c178b5c79c..00000000000 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.conf +++ /dev/null @@ -1,5 +0,0 @@ -# $Id$ -# -dynamic SHMIOP_Factory Service_Object *TAO_Strategies:_make_TAO_SHMIOP_Protocol_Factory () "-MMAPFilePrefix server_shmiop " -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.cpp b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.cpp index 39fd715b0f7..4893b44106c 100644 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.cpp +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/server.cpp @@ -2,6 +2,8 @@ #include "testS.h" #include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "tao/ORB_Core.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "tao/Strategies/advanced_resource.h" @@ -41,7 +43,7 @@ Test_i::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /* ACE_ENV_SINGLE_ARG_PARA void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -89,43 +91,50 @@ check_for_nil (CORBA::Object_ptr obj, const char *msg) return 0; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // ORB. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +public: - // Parse arguments. - if (parse_args (argc, argv) != 0) - return 1; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + int svc (void); + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { // RTORB. CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // RootPOA. object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; + return -1; // POAManager. PortableServer::POAManager_var poa_manager = @@ -149,7 +158,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; // Create object. - Test_i server_impl (orb.in ()); + Test_i server_impl (this->orb_.in ()); PortableServer::ObjectId_var id = child_poa->activate_object (&server_impl ACE_ENV_ARG_PARAMETER); @@ -162,7 +171,7 @@ main (int argc, char *argv[]) // Print Object IOR. CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); + this->orb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n\n", ior.in ())); @@ -174,7 +183,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output file for writing IOR: %s", ior_output_file), - 1); + -1); ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); } @@ -184,7 +193,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; // Start ORB event loop. - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Server ORB event loop finished\n\n")); @@ -192,8 +201,73 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in MT_Client_Protocol_Priority test server:"); - return 1; + "Unexpected exception caught in MT_Client_Protocol_Priority test server:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // ORB. + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Parse arguments. + if (parse_args (argc, argv) != 0) + return -1; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf new file mode 100644 index 00000000000..d5c77cef4a9 --- /dev/null +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf @@ -0,0 +1,7 @@ +# Options for SHMIOP protocol +static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" + +# No other options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf.xml b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf.xml new file mode 100644 index 00000000000..20e6e885da4 --- /dev/null +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf.xml @@ -0,0 +1,9 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- Options for SHMIOP protocol --> + <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> + <!-- No other options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/ORB_init/ORB_init.cpp b/TAO/tests/RTCORBA/ORB_init/ORB_init.cpp index 8dcd0109718..a401b67193f 100644 --- a/TAO/tests/RTCORBA/ORB_init/ORB_init.cpp +++ b/TAO/tests/RTCORBA/ORB_init/ORB_init.cpp @@ -3,7 +3,6 @@ #include "tao/corba.h" #include "tao/RTCORBA/RTCORBA.h" #include "ace/Get_Opt.h" -#include "../check_supported_priorities.cpp" int test_multiple_orbs (const char *test_name, @@ -35,10 +34,6 @@ test_multiple_orbs (const char *test_name, ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orbs[i].in()); - if (rt_orb) { CORBA::Object_var object = diff --git a/TAO/tests/RTCORBA/ORB_init/svc.conf b/TAO/tests/RTCORBA/ORB_init/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/ORB_init/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Persistent_IOR/client.cpp b/TAO/tests/RTCORBA/Persistent_IOR/client.cpp index d99f3548e2b..9fc50f20a4b 100644 --- a/TAO/tests/RTCORBA/Persistent_IOR/client.cpp +++ b/TAO/tests/RTCORBA/Persistent_IOR/client.cpp @@ -2,7 +2,6 @@ #include "ace/Get_Opt.h" #include "testC.h" -#include "../check_supported_priorities.cpp" static int iterations = 5; static int shutdown_server = 0; @@ -66,10 +65,6 @@ main (int argc, char **argv) parse_args (argc, argv); if (result != 0) return result; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); CORBA::Object_var object = orb->string_to_object (ior diff --git a/TAO/tests/RTCORBA/Persistent_IOR/server.cpp b/TAO/tests/RTCORBA/Persistent_IOR/server.cpp index 927310ca868..8b4269ac9e7 100644 --- a/TAO/tests/RTCORBA/Persistent_IOR/server.cpp +++ b/TAO/tests/RTCORBA/Persistent_IOR/server.cpp @@ -3,7 +3,6 @@ #include "ace/Get_Opt.h" #include "testS.h" #include "tao/RTPortableServer/RTPortableServer.h" -#include "../check_supported_priorities.cpp" class test_i : public POA_test, @@ -340,10 +339,6 @@ main (int argc, char **argv) parse_args (argc, argv); if (result != 0) return result; - - // Make sure we can support multiple priorities that are required - // for this test. - //check_supported_priorities (orb.in()); CORBA::Object_var object = orb->resolve_initial_references ("RTORB" diff --git a/TAO/tests/RTCORBA/Persistent_IOR/svc.conf b/TAO/tests/RTCORBA/Persistent_IOR/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/Persistent_IOR/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Policies/svc.conf b/TAO/tests/RTCORBA/Policies/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/Policies/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Policy_Combinations/client.cpp b/TAO/tests/RTCORBA/Policy_Combinations/client.cpp index 9048662ae0b..bb9f688d7ca 100644 --- a/TAO/tests/RTCORBA/Policy_Combinations/client.cpp +++ b/TAO/tests/RTCORBA/Policy_Combinations/client.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/Get_Opt.h" +#include "ace/Task.h" #include "testC.h" #include "tao/ORB_Core.h" #include "tao/RTCORBA/RTCORBA.h" @@ -52,49 +53,34 @@ parse_args (int argc, char **argv) return 0; } -int -main (int argc, char **argv) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +public: - int result = - parse_args (argc, argv); - if (result != 0) - return result; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // The following sets the current thread to the lowest priority - // for this scheduling policy. This will give us the biggest - // range on NT since the default priority is 0 where as the - // lowest priority is -15. - ACE_hthread_t current_thread; - ACE_Thread::self (current_thread); + int svc (void); - long sched_policy = - orb->orb_core ()->orb_params ()->sched_policy (); + CORBA::ORB_var orb_; - int minimum_priority = - ACE_Sched_Params::priority_min (sched_policy); +}; - result = - ACE_Thread::setprio (current_thread, - minimum_priority); - if (result != 0) - return result; +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { CORBA::Object_var object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -107,8 +93,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->string_to_object (ior - ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; test_var test = @@ -152,3 +138,80 @@ main (int argc, char **argv) return 0; } + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // The following finds out the lowest priority for this + // scheduling policy. This will give us the biggest range on NT + // since the default priority is 0 where as the lowest priority + // is -15. + int minimum_priority = + ACE_Sched_Params::priority_min (orb->orb_core ()->orb_params ()->ace_sched_policy ()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags, + 1, 0, + minimum_priority); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception!"); + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/RTCORBA/Policy_Combinations/run_test.pl b/TAO/tests/RTCORBA/Policy_Combinations/run_test.pl index 2fae893f072..3a8932a1c53 100755 --- a/TAO/tests/RTCORBA/Policy_Combinations/run_test.pl +++ b/TAO/tests/RTCORBA/Policy_Combinations/run_test.pl @@ -59,7 +59,6 @@ for $file (@iorfiles) $server = $SV->TimedWait (1); if ($server == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/Policy_Combinations/server.cpp b/TAO/tests/RTCORBA/Policy_Combinations/server.cpp index b27d0567f4b..c8765bbc557 100644 --- a/TAO/tests/RTCORBA/Policy_Combinations/server.cpp +++ b/TAO/tests/RTCORBA/Policy_Combinations/server.cpp @@ -3,6 +3,7 @@ #include "ace/Get_Opt.h" #include "testS.h" #include "tao/ORB_Core.h" +#include "ace/Task.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "../check_supported_priorities.cpp" @@ -751,24 +752,33 @@ server::test_lanes_bands_server_declared_poa (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char **argv) +Task::svc (void) { ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); - CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" + this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -784,8 +794,8 @@ main (int argc, char **argv) ACE_hthread_t current_thread; ACE_Thread::self (current_thread); - long sched_policy = - orb->orb_core ()->orb_params ()->sched_policy (); + int sched_policy = + this->orb_->orb_core ()->orb_params ()->ace_sched_policy (); int minimum_priority = ACE_Sched_Params::priority_min (sched_policy); @@ -797,7 +807,7 @@ main (int argc, char **argv) return result; object = - orb->resolve_initial_references ("RTCurrent" + this->orb_->resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -816,13 +826,8 @@ main (int argc, char **argv) server_priority = default_thread_priority + 5; - result = - parse_args (argc, argv); - if (result != 0) - return result; - object = - orb->resolve_initial_references ("RootPOA" + this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -835,7 +840,7 @@ main (int argc, char **argv) root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - server server (orb.in (), + server server (this->orb_.in (), rt_orb.in (), root_poa.in (), poa_manager.in ()); @@ -885,11 +890,79 @@ main (int argc, char **argv) poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); } ACE_CATCHANY { diff --git a/TAO/tests/RTCORBA/Policy_Combinations/svc.conf b/TAO/tests/RTCORBA/Policy_Combinations/svc.conf index 2f674555d9f..4f8bca41eeb 100644 --- a/TAO/tests/RTCORBA/Policy_Combinations/svc.conf +++ b/TAO/tests/RTCORBA/Policy_Combinations/svc.conf @@ -1,2 +1,6 @@ -static RT_ORB_Loader "-ORBPriorityMapping continuous -ORBSchedPolicy SCHED_FIFO" +# Options required for regular testing; comment out for real-time testing +static RT_ORB_Loader "-ORBPriorityMapping continuous" + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBPriorityMapping continuous -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Policy_Combinations/svc.conf.xml b/TAO/tests/RTCORBA/Policy_Combinations/svc.conf.xml index db942b7a850..575234501d6 100644 --- a/TAO/tests/RTCORBA/Policy_Combinations/svc.conf.xml +++ b/TAO/tests/RTCORBA/Policy_Combinations/svc.conf.xml @@ -1,5 +1,8 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Policy_Combinations/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> + <!-- Options required for regular testing --> <static id="RT_ORB_Loader" params="-ORBPriorityMapping continuous"/> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBPriorityMapping continuous -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Private_Connection/client.cpp b/TAO/tests/RTCORBA/Private_Connection/client.cpp index afd2254d188..a1b7369b55d 100644 --- a/TAO/tests/RTCORBA/Private_Connection/client.cpp +++ b/TAO/tests/RTCORBA/Private_Connection/client.cpp @@ -3,7 +3,6 @@ #include "testC.h" #include "tao/RTCORBA/RTCORBA.h" #include "ace/Get_Opt.h" -#include "../check_supported_priorities.cpp" const char *ior1 = "file://test1.ior"; const char *ior2 = "file://test2.ior"; @@ -63,11 +62,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // RTORB. CORBA::Object_var object = @@ -77,7 +72,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // PolicyCurrent. object = orb->resolve_initial_references ("PolicyCurrent" @@ -88,7 +83,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (check_for_nil (policy_current.in (), "PolicyCurrent") == -1) - return 1; + return -1; // Test object 1. object = orb->string_to_object (ior1 ACE_ENV_ARG_PARAMETER); @@ -96,7 +91,7 @@ main (int argc, char *argv[]) Test_var server1 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server1.in (), "server1") == -1) - return 1; + return -1; // Test object 2. object = orb->string_to_object (ior2 ACE_ENV_ARG_PARAMETER); @@ -104,7 +99,7 @@ main (int argc, char *argv[]) Test_var server2 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server2.in (), "server2") == -1) - return 1; + return -1; // Make four invocations on test objects. Expected: connection // established on the first invocation, and reused in the @@ -175,11 +170,10 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Private_Connection test client:"); - return 1; + "Unexpected exception caught in Private_Connection test client:"); + return -1; } ACE_ENDTRY; return 0; } - diff --git a/TAO/tests/RTCORBA/Private_Connection/server.cpp b/TAO/tests/RTCORBA/Private_Connection/server.cpp index 580fb8a361c..5d33dca1dfd 100644 --- a/TAO/tests/RTCORBA/Private_Connection/server.cpp +++ b/TAO/tests/RTCORBA/Private_Connection/server.cpp @@ -4,7 +4,6 @@ #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "ace/Get_Opt.h" -#include "../check_supported_priorities.cpp" class Test_i : public POA_Test { @@ -42,7 +41,7 @@ Test_i::test_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAM void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -149,11 +148,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // RootPOA. CORBA::Object_var object = @@ -163,7 +158,7 @@ main (int argc, char *argv[]) PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; + return -1; // POAManager. PortableServer::POAManager_var poa_manager = @@ -183,7 +178,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; result = create_object (root_poa.in (), orb.in (), @@ -192,7 +187,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Run ORB Event loop. poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -206,11 +201,10 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Private_Connection test server:"); - return 1; + "Unexpected exception caught in Private_Connection test server:"); + return -1; } ACE_ENDTRY; return 0; } - diff --git a/TAO/tests/RTCORBA/Private_Connection/svc.conf b/TAO/tests/RTCORBA/Private_Connection/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/Private_Connection/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp index 07621823453..d0e81d50330 100644 --- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp +++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/client.cpp @@ -16,6 +16,7 @@ #include "ace/Get_Opt.h" #include "ace/Task.h" +#include "tao/ORB_Core.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/Strategies/advanced_resource.h" #include "../check_supported_priorities.cpp" @@ -133,7 +134,8 @@ private: class Worker_Thread : public ACE_Task_Base { public: - Worker_Thread (Client &client, + Worker_Thread (ACE_Thread_Manager &thread_manager, + Client &client, test_ptr test, RTCORBA::Current_ptr current, CORBA::Short priority); @@ -149,11 +151,13 @@ private: CORBA::Short priority_; }; -Worker_Thread::Worker_Thread (Client &client, +Worker_Thread::Worker_Thread (ACE_Thread_Manager &thread_manager, + Client &client, test_ptr test, RTCORBA::Current_ptr current, CORBA::Short priority) - : client_ (client), + : ACE_Task_Base (&thread_manager), + client_ (client), test_ (test::_duplicate (test)), current_ (RTCORBA::Current::_duplicate (current)), priority_ (priority) @@ -272,12 +276,15 @@ Client::priority_invocations (int debug Worker_Thread *[priorities.size ()], CORBA::NO_MEMORY ()); + ACE_Thread_Manager thread_manager; + for (i = 0; i < priorities.size (); ++i) { ACE_NEW_THROW_EX (workers[i], - Worker_Thread (*this, + Worker_Thread (thread_manager, + *this, this->test_.in (), this->current_.in (), priorities[i]), @@ -286,8 +293,7 @@ Client::priority_invocations (int debug long flags = THR_NEW_LWP | THR_JOINABLE | - this->orb_->orb_core ()->orb_params ()->scope_policy () | - this->orb_->orb_core ()->orb_params ()->sched_policy (); + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); result = workers[i]->activate (flags); @@ -299,7 +305,7 @@ Client::priority_invocations (int debug } } - ACE_Thread_Manager::instance ()->wait (); + thread_manager.wait (); for (i = 0; i < priorities.size (); @@ -393,28 +399,35 @@ Client::reset_policies (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; } -int -main (int argc, char **argv) +class Task : public ACE_Task_Base { - ACE_DECLARE_NEW_CORBA_ENV; +public: - ACE_TRY - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in () @@ -422,8 +435,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("ORBPolicyManager" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::PolicyManager_var policy_manager = @@ -432,8 +445,8 @@ main (int argc, char **argv) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -445,14 +458,9 @@ main (int argc, char **argv) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - int parse_args_result = - parse_args (argc, argv); - if (parse_args_result != 0) - return parse_args_result; - object = - orb->string_to_object (ior - ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; test_var test = @@ -461,7 +469,7 @@ main (int argc, char **argv) ACE_TRY_CHECK; Client client (test.in (), - orb.in (), + this->orb_.in (), current.in (), rt_orb.in (), policy_manager.in ()); @@ -550,3 +558,74 @@ main (int argc, char **argv) return 0; } + +int +main (int argc, char **argv) +{ + ACE_DECLARE_NEW_CORBA_ENV; + + ACE_TRY + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int parse_args_result = + parse_args (argc, argv); + if (parse_args_result != 0) + return parse_args_result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error!"); + return -1; + } + ACE_ENDTRY; + ACE_CHECK_RETURN (-1); + + return 0; +} diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl index 3a2ab1bfec4..bfc0b0ebaef 100755 --- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl +++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl @@ -130,7 +130,6 @@ sub check_supported_priorities $process = shift; $returnVal = $process->TimedWait (1); if ($returnVal == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $process->{RUNNING} = 0; exit 0; diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/server.cpp b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/server.cpp index 37b0eea457f..e24b4ee483b 100644 --- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/server.cpp +++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/server.cpp @@ -61,20 +61,20 @@ test_i::method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) this->orb_->orb_core ()->get_tss_resources (); /// Get the lane attribute in TSS. - TAO_Thread_Lane *lane = - (TAO_Thread_Lane *) tss->lane_; + TAO_Thread_Lane *lane = + (TAO_Thread_Lane *) tss->lane_; - if (debug) - { - if (lane) - ACE_DEBUG ((LM_DEBUG, - "test_i::method request in thread %t (pool id = %d; lane id = %d)\n", - lane->pool ().id (), - lane->id ())); - else - ACE_DEBUG ((LM_DEBUG, - "test_i::method request in thread %t (default thread pool)\n")); - } + if (debug) + { + if (lane) + ACE_DEBUG ((LM_DEBUG, + "test_i::method request in thread %t (pool id = %d; lane id = %d)\n", + lane->pool ().id (), + lane->id ())); + else + ACE_DEBUG ((LM_DEBUG, + "test_i::method request in thread %t (default thread pool)\n")); + } } void @@ -309,24 +309,33 @@ rt_poa (CORBA::ORB_ptr orb, ACE_CHECK; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char **argv) +Task::svc (void) { ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); - CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" + this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -335,13 +344,8 @@ main (int argc, char **argv) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - int result = - parse_args (argc, argv); - if (result != 0) - return result; - object = - orb->resolve_initial_references ("RootPOA" + this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -354,13 +358,13 @@ main (int argc, char **argv) root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - vanilla_poa (orb.in (), + vanilla_poa (this->orb_.in (), root_poa.in (), poa_manager.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - rt_poa (orb.in (), + rt_poa (this->orb_.in (), rt_orb.in (), root_poa.in (), poa_manager.in () @@ -370,10 +374,10 @@ main (int argc, char **argv) poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY @@ -385,3 +389,71 @@ main (int argc, char **argv) return 0; } + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf index 6698f1f8699..6bfc6d18fd8 100644 --- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf +++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf @@ -1,7 +1,10 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" -static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO" +# Options required for regular testing; comment out for real-time testing +static RT_ORB_Loader "-ORBPriorityMapping linear" + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" + diff --git a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf.xml b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf.xml index 80ee9a66f6c..87504a564ec 100644 --- a/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf.xml +++ b/TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf.xml @@ -1,9 +1,13 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Profile_And_Endpoint_Selection/svc.conf by svcconf-convert.pl --> +<!-- Converted from svc.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- --> <!-- $Id$ --> <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> + <!-- Options required for regular testing --> <static id="RT_ORB_Loader" params="-ORBPriorityMapping linear"/> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBPriorityMapping linear -ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/RTCORBA-test-configurations.xls b/TAO/tests/RTCORBA/RTCORBA-test-configurations.xls Binary files differnew file mode 100644 index 00000000000..2157e01fa0e --- /dev/null +++ b/TAO/tests/RTCORBA/RTCORBA-test-configurations.xls diff --git a/TAO/tests/RTCORBA/RTMutex/server.cpp b/TAO/tests/RTCORBA/RTMutex/server.cpp index 06d416283e1..dc84e9a7046 100644 --- a/TAO/tests/RTCORBA/RTMutex/server.cpp +++ b/TAO/tests/RTCORBA/RTMutex/server.cpp @@ -5,7 +5,6 @@ #include "ace/Thread_Manager.h" #include "ace/High_Res_Timer.h" #include "ace/Get_Opt.h" -#include "../check_supported_priorities.cpp" static int test_try_lock_flag = #if defined (ACE_HAS_MUTEX_TIMEOUTS) && !defined (ACE_HAS_WTHREADS) @@ -90,7 +89,7 @@ test_mutex_simple (RTCORBA::RTORB_ptr rt_orb) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in test_mutex_simple()"); - return 1; + return -1; } ACE_ENDTRY; @@ -116,7 +115,7 @@ test_named_mutex_simple (RTCORBA::RTORB_ptr rt_orb) if (created_flag != 1) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Expected named mutex larry to be created, but it wasn't\n"), - 1); + -1); moe_mutex1 = rt_orb->create_named_mutex ("moe", created_flag @@ -126,7 +125,7 @@ test_named_mutex_simple (RTCORBA::RTORB_ptr rt_orb) if (created_flag != 1) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Expected named mutex moe to be created, but it wasn't\n"), - 1); + -1); larry_mutex1->lock (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -145,14 +144,14 @@ test_named_mutex_simple (RTCORBA::RTORB_ptr rt_orb) if (created_flag != 0) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Expected named mutex to already be created, but it wasn't\n"), - 1); + -1); // test the pointers... if (ACE_reinterpret_cast (void *, larry_mutex1.in ()) != ACE_reinterpret_cast (void *, larry_mutex2.in ())) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Should have gotten the same mutex, but didn't\n"), - 1); + -1); larry_mutex2->lock (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -173,7 +172,7 @@ test_named_mutex_simple (RTCORBA::RTORB_ptr rt_orb) != ACE_reinterpret_cast (void *,larry_mutex3.in ())) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Should have gotten the same mutex, but didn't\n"), - 1); + -1); larry_mutex3->lock (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -199,7 +198,7 @@ test_named_mutex_simple (RTCORBA::RTORB_ptr rt_orb) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in test_named_mutex_simple()"); - return 1; + return -1; } ACE_ENDTRY; @@ -222,7 +221,7 @@ test_named_mutex_exception (RTCORBA::RTORB_ptr rt_orb) ACE_ERROR_RETURN ((LM_ERROR, "Expected a MutexNotFound exception, but didn't get one.\n"), - 1); + -1); } ACE_CATCH (RTCORBA::RTORB::MutexNotFound, ex) { @@ -232,7 +231,7 @@ test_named_mutex_exception (RTCORBA::RTORB_ptr rt_orb) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in test_named_mutex_exception()"); - return 1; + return -1; } ACE_ENDTRY; @@ -280,7 +279,7 @@ mutex_test_thread (void *args) if (*shared_var != 0) { ACE_ERROR ((LM_ERROR, - "Expected shared_var to be 0 under the mutex\n")); + "Expected shared_var to be 0 under the mutex\n")); *data->error_flag = 1; } @@ -366,7 +365,7 @@ test_mutex_threads (RTCORBA::RTORB_ptr rt_orb) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in test_mutex_threads()"); - return 1; + return -1; } ACE_ENDTRY; @@ -425,7 +424,7 @@ mutex_test_try_lock_thread (void *args) measured.usec())); if ((measured.sec() == 4 && measured.usec() >= 500000) - || (measured.sec() == 5 && measured.usec() <= 500000)) + || (measured.sec() == 5 && measured.usec() <= 500000)) /* success */; else { @@ -467,7 +466,7 @@ test_mutex_try_lock (RTCORBA::RTORB_ptr rt_orb) if (!result) ACE_ERROR_RETURN ((LM_ERROR, "try_lock failed\n"), - 1); + -1); test_data.mutex = mutex; test_data.shared_var = &shared_var; @@ -492,7 +491,7 @@ test_mutex_try_lock (RTCORBA::RTORB_ptr rt_orb) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in test_mutex_try_lock()"); - return 1; + return -1; } ACE_ENDTRY; @@ -512,11 +511,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // RTORB. CORBA::Object_var object = @@ -526,7 +521,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; ACE_DEBUG ((LM_DEBUG, "Running RTCORBA Mutex unit tests\n")); @@ -534,18 +529,18 @@ main (int argc, char *argv[]) if (test_mutex_simple (rt_orb.in ()) != 0) ACE_ERROR_RETURN ((LM_ERROR, "test_mutex_simple failed\n"), - 1); + -1); #if (TAO_HAS_NAMED_RT_MUTEXES == 1) if (test_named_mutex_simple (rt_orb.in ()) != 0) ACE_ERROR_RETURN ((LM_ERROR, "test_named_mutex_simple failed\n"), - 1); + -1); if (test_named_mutex_exception (rt_orb. in ()) != 0) ACE_ERROR_RETURN ((LM_ERROR, "test_named_mutex_exception failed\n"), - 1); + -1); #else ACE_DEBUG ((LM_DEBUG, "Named RT_Mutex support is not enabled. " @@ -557,11 +552,11 @@ main (int argc, char *argv[]) if (test_mutex_threads (rt_orb.in ()) != 0) ACE_ERROR_RETURN ((LM_ERROR, "test_mutex_threads failed\n"), - 1); + -1); else if (test_mutex_try_lock (rt_orb.in ()) != 0) ACE_ERROR_RETURN ((LM_ERROR, "test_mutex_try_lock failed\n"), - 1); + -1); #endif /* ACE_HAS_THREADS */ @@ -571,10 +566,9 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception caught in Mutex test server:"); - return 1; + return -1; } ACE_ENDTRY; return 0; } - diff --git a/TAO/tests/RTCORBA/RTMutex/svc.conf b/TAO/tests/RTCORBA/RTMutex/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/RTMutex/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Server_Declared/client.cpp b/TAO/tests/RTCORBA/Server_Declared/client.cpp index 5e6be15a68e..9ac3ce834d6 100644 --- a/TAO/tests/RTCORBA/Server_Declared/client.cpp +++ b/TAO/tests/RTCORBA/Server_Declared/client.cpp @@ -3,7 +3,6 @@ #include "testC.h" #include "ace/Get_Opt.h" #include "tao/RTCORBA/RTCORBA.h" -#include "../check_supported_priorities.cpp" const char *ior1 = "file://test1.ior"; const char *ior2 = "file://test2.ior"; @@ -91,11 +90,7 @@ main (int argc, char *argv[]) // Parse arguments. if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; // Test object 1. CORBA::Object_var object = @@ -105,16 +100,16 @@ main (int argc, char *argv[]) Test_var server1 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server1.in (), "server1") == -1) - return 1; + return -1; // Test object 2. object = orb->string_to_object (ior2 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - Test_var server2 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); + Test_var server2 = Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (server2.in (), "server2") == -1) - return 1; + return -1; // Check that test objects are configured with SERVER_DECLARED // PriorityModelPolicy, and get their server priorities. @@ -124,17 +119,17 @@ main (int argc, char *argv[]) check_policy (server1.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (server1_priority == -1) - return 1; + if (server1_priority == -1) + return -1; - // Test object 2. + // Test object 2. CORBA::Short server2_priority = check_policy (server2.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (server2_priority == -1) - return 1; + return -1; - // Testing: make several invocations on test objects. + // Testing: make several invocations on test objects. for (int i = 0; i < 5; ++i) { server1->test_method (server1_priority ACE_ENV_ARG_PARAMETER); @@ -142,8 +137,7 @@ main (int argc, char *argv[]) server2->test_method (server2_priority ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - } + } // Testing over. Shut down Server ORB. server1->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -153,8 +147,8 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception in Server_Declared test client:"); - return 1; + "Unexpected exception in Server_Declared test client:"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Server_Declared/run_test.pl b/TAO/tests/RTCORBA/Server_Declared/run_test.pl index 57e63771677..37d8318df43 100755 --- a/TAO/tests/RTCORBA/Server_Declared/run_test.pl +++ b/TAO/tests/RTCORBA/Server_Declared/run_test.pl @@ -15,13 +15,8 @@ unlink $iorfile1; unlink $iorfile2; $status = 0; -# CORBA priorities 65, 70 and 75 are for the SCHED_OTHER class on -# Solaris. May need to use different values for other platforms -# depending on their native priorities scheme, i.e., based on the -# available range. - $server_args = - "-p $iorfile1 -o $iorfile2 -a 65 -b 75"; + "-p $iorfile1 -o $iorfile2 -a 45 -b 55"; print STDERR "Value is " . $^O; @@ -53,7 +48,6 @@ if (PerlACE::waitforfile_timed ($iorfile2, 10) == -1) $server = $SV->TimedWait (1); if ($server == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/Server_Declared/server.conf b/TAO/tests/RTCORBA/Server_Declared/server.conf deleted file mode 100644 index 1a3860c473e..00000000000 --- a/TAO/tests/RTCORBA/Server_Declared/server.conf +++ /dev/null @@ -1,3 +0,0 @@ -# $Id$ -# -static Advanced_Resource_Factory "-ORBReactorType tp -ORBReactorRegistry per-priority" diff --git a/TAO/tests/RTCORBA/Server_Declared/server.conf.xml b/TAO/tests/RTCORBA/Server_Declared/server.conf.xml deleted file mode 100644 index e42a75c8904..00000000000 --- a/TAO/tests/RTCORBA/Server_Declared/server.conf.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Declared/server.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- $Id$ --> - <!-- --> - <static id="Advanced_Resource_Factory" params="-ORBReactorType tp -ORBReactorRegistry per-priority"/> -</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Declared/server.cpp b/TAO/tests/RTCORBA/Server_Declared/server.cpp index 78322d043b9..8c01de8397d 100644 --- a/TAO/tests/RTCORBA/Server_Declared/server.cpp +++ b/TAO/tests/RTCORBA/Server_Declared/server.cpp @@ -2,6 +2,8 @@ #include "testS.h" #include "ace/Get_Opt.h" +#include "tao/ORB_Core.h" +#include "ace/Task.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "../check_supported_priorities.cpp" @@ -69,7 +71,7 @@ Test_i::test_method (CORBA::Short priority void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } @@ -202,43 +204,50 @@ create_object (RTPortableServer::POA_ptr poa, return 0; } -int -main (int argc, char *argv[]) +class Task : public ACE_Task_Base { - ACE_TRY_NEW_ENV - { - // ORB. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; +public: - // Parse arguments. - if (parse_args (argc, argv) != 0) - return 1; + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + int svc (void); + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +int +Task::svc (void) +{ + ACE_TRY_NEW_ENV + { // RTORB. CORBA::Object_var object = - orb->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_orb.in (), "RTORB") == -1) - return 1; + return -1; // RootPOA. object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (root_poa.in (), "RootPOA") == -1) - return 1; + return -1; // POAManager. PortableServer::POAManager_var poa_manager = @@ -258,7 +267,7 @@ main (int argc, char *argv[]) poa_policy_list[1] = root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var child_poa = @@ -272,35 +281,34 @@ main (int argc, char *argv[]) RTPortableServer::POA::_narrow (child_poa.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (check_for_nil (rt_poa.in (), "RTPOA") == -1) - return 1; - + return -1; // Servant. - Test_i server_impl (orb.in ()); + Test_i server_impl (this->orb_.in ()); // Create object 1 (it will inherit POA's priority). int result; ACE_DEBUG ((LM_DEBUG, "\nActivated object one as ")); - result = create_object (rt_poa.in (), orb.in (), &server_impl, + result = create_object (rt_poa.in (), this->orb_.in (), &server_impl, -1, ior_output_file1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Create object 2 (override POA's priority). ACE_DEBUG ((LM_DEBUG, "\nActivated object two as ")); - result = create_object (rt_poa.in (), orb.in (), &server_impl, + result = create_object (rt_poa.in (), this->orb_.in (), &server_impl, object_priority, ior_output_file2 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == -1) - return 1; + return -1; // Activate POA manager. poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; // Start ORB event loop. - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Server ORB event loop finished\n\n")); @@ -308,8 +316,73 @@ main (int argc, char *argv[]) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in Server_Declared test server:"); - return 1; + "Unexpected exception caught in Server_Declared test server:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // ORB. + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Parse arguments. + if (parse_args (argc, argv) != 0) + return -1; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Server_Declared/svc.conf b/TAO/tests/RTCORBA/Server_Declared/svc.conf index 37973382e2c..2154375e265 100644 --- a/TAO/tests/RTCORBA/Server_Declared/svc.conf +++ b/TAO/tests/RTCORBA/Server_Declared/svc.conf @@ -1,2 +1,4 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" +# No options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Server_Declared/svc.conf.xml b/TAO/tests/RTCORBA/Server_Declared/svc.conf.xml new file mode 100644 index 00000000000..b589f90605b --- /dev/null +++ b/TAO/tests/RTCORBA/Server_Declared/svc.conf.xml @@ -0,0 +1,7 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- No options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/client.cpp b/TAO/tests/RTCORBA/Server_Protocol/client.cpp index 03ca0cf6bd2..7dd24cdb9b5 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/client.cpp +++ b/TAO/tests/RTCORBA/Server_Protocol/client.cpp @@ -4,7 +4,6 @@ #include "ace/Get_Opt.h" #include "tao/RTCORBA/RTCORBA.h" #include "tao/Strategies/advanced_resource.h" -#include "../check_supported_priorities.cpp" const char *ior = "file://test.ior"; @@ -44,11 +43,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; CORBA::Object_var object = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); @@ -63,7 +58,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "ERROR: Object reference <%s> is nil\n", ior), - 1); + -1); } // Make an invocation on the obtained Test object. @@ -74,7 +69,7 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:"); - return 1; + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Server_Protocol/server.cpp b/TAO/tests/RTCORBA/Server_Protocol/server.cpp index 5fb692eab8f..e7f66eef001 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server.cpp +++ b/TAO/tests/RTCORBA/Server_Protocol/server.cpp @@ -6,7 +6,6 @@ #include "tao/RTCORBA/RT_Policy_i.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "tao/Strategies/advanced_resource.h" -#include "../check_supported_priorities.cpp" class Test_i : public POA_Test { @@ -32,7 +31,7 @@ Test_i::Test_i (CORBA::ORB_ptr orb) void Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_DEBUG ((LM_DEBUG, "Received request to shut down the ORB\n")); @@ -93,8 +92,8 @@ check_default_server_protocol (CORBA::ORB_ptr orb // is no standard way to access ORB default policies). CORBA::Policy_var server_protocol = orb->orb_core ()->get_default_policies ()->get_policy ( - RTCORBA::SERVER_PROTOCOL_POLICY_TYPE - ACE_ENV_ARG_PARAMETER); + RTCORBA::SERVER_PROTOCOL_POLICY_TYPE + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); RTCORBA::ServerProtocolPolicy_var policy = @@ -177,11 +176,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (parse_args (argc, argv) != 0) - return 1; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); + return -1; CORBA::Object_var object = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); @@ -211,7 +206,7 @@ main (int argc, char *argv[]) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result != 0) - return 1; + return -1; // If a protocol type was indicated using command line option, // create a child POA with ServerProtocolPolicy containing @@ -276,7 +271,7 @@ main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output file for writing IOR: %s", ior_output_file), - 1); + -1); ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); } @@ -294,7 +289,7 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf b/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf index 0ae86472d12..6970cc7974c 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf +++ b/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf @@ -1,3 +1,2 @@ -# +# Protocol options static Advanced_Resource_Factory "-ORBProtocolFactory IIOP_Factory" -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf.xml b/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf.xml index 5c9e87402a4..a4aed9ed5d7 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf.xml +++ b/TAO/tests/RTCORBA/Server_Protocol/server_iiop.conf.xml @@ -1,6 +1,6 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Protocol/server_iiop.conf by svcconf-convert.pl --> +<!-- Converted from server_iiop.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> + <!-- Protocol options --> <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory IIOP_Factory"/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf b/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf index f92ee315a95..8f1988df985 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf +++ b/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf @@ -1,6 +1,5 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" -static Advanced_Resource_Factory "-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory UIOP_Factory -ORBProtocolFactory IIOP_Factory " -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" + +# Protocol options +static Advanced_Resource_Factory "-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory UIOP_Factory -ORBProtocolFactory IIOP_Factory" diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf.xml b/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf.xml index a9955b1f313..9154765d4dd 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf.xml +++ b/TAO/tests/RTCORBA/Server_Protocol/server_reverse.conf.xml @@ -1,9 +1,8 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Protocol/server_reverse.conf by svcconf-convert.pl --> +<!-- Converted from server_reverse.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> - <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory UIOP_Factory -ORBProtocolFactory IIOP_Factory "/> + <!-- Protocol options --> + <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory UIOP_Factory -ORBProtocolFactory IIOP_Factory"/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf b/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf index 6685d183021..9e1b5d05bab 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf +++ b/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf @@ -1,6 +1,5 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" + +# Protocol options static Advanced_Resource_Factory "-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory IIOP_Factory" -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf.xml b/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf.xml index 2c4ef52dc95..dc1e7f12579 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf.xml +++ b/TAO/tests/RTCORBA/Server_Protocol/server_reverse_nt.conf.xml @@ -1,9 +1,8 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Protocol/server_reverse_nt.conf by svcconf-convert.pl --> +<!-- Converted from server_reverse_nt.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> + <!-- Protocol options --> <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory SHMIOP_Factory -ORBProtocolFactory IIOP_Factory"/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf b/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf index d072ca1f54d..c75f08cdd40 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf +++ b/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf @@ -1,6 +1,6 @@ -# -# $Id$ -# +# Options for SHMIOP protocol static SHMIOP_Factory "-MMAPFilePrefix server_shmiop" + +# Protocol options static Advanced_Resource_Factory "-ORBProtocolFactory SHMIOP_Factory " -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" + diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf.xml b/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf.xml index e98625421d3..9ffdb8c899f 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf.xml +++ b/TAO/tests/RTCORBA/Server_Protocol/server_shmiop.conf.xml @@ -1,9 +1,8 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Protocol/server_shmiop.conf by svcconf-convert.pl --> +<!-- Converted from server_shmiop.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Options for SHMIOP protocol --> <static id="SHMIOP_Factory" params="-MMAPFilePrefix server_shmiop"/> + <!-- Protocol options --> <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory SHMIOP_Factory "/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf b/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf index d2a1c1ccb87..eb6162bccf2 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf +++ b/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf @@ -1,5 +1,2 @@ -# -# $Id$ -# +# Protocol options static Advanced_Resource_Factory "-ORBProtocolFactory UIOP_Factory " -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf.xml b/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf.xml index e4724ed6935..911f616d4fa 100644 --- a/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf.xml +++ b/TAO/tests/RTCORBA/Server_Protocol/server_uiop.conf.xml @@ -1,8 +1,6 @@ <?xml version='1.0'?> -<!-- Converted from ./tests/RTCORBA/Server_Protocol/server_uiop.conf by svcconf-convert.pl --> +<!-- Converted from server_uiop.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> + <!-- Protocol options --> <static id="Advanced_Resource_Factory" params="-ORBProtocolFactory UIOP_Factory "/> </ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/Server_Protocol/svc.conf b/TAO/tests/RTCORBA/Server_Protocol/svc.conf deleted file mode 100644 index 37973382e2c..00000000000 --- a/TAO/tests/RTCORBA/Server_Protocol/svc.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" diff --git a/TAO/tests/RTCORBA/Thread_Pool/client.cpp b/TAO/tests/RTCORBA/Thread_Pool/client.cpp index 4036a75c1a2..55b8e23de04 100644 --- a/TAO/tests/RTCORBA/Thread_Pool/client.cpp +++ b/TAO/tests/RTCORBA/Thread_Pool/client.cpp @@ -3,6 +3,8 @@ #include "ace/Get_Opt.h" #include "testC.h" #include "tao/RTCORBA/RTCORBA.h" +#include "tao/ORB_Core.h" +#include "ace/Task.h" #include "../check_supported_priorities.cpp" ACE_RCSID(Thread_Pool, client, "$Id$") @@ -48,26 +50,33 @@ parse_args (int argc, char *argv[]) return 0; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char *argv[]) +Task::svc (void) { ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - int result = - parse_args (argc, argv); - if (result != 0) - return result; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + this->orb_->string_to_object (ior ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; test_var test = @@ -86,7 +95,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; ACE_ASSERT (r == i); - /// Assert disappears on with optimizations on. + // Assert disappears on with optimizations on. ACE_UNUSED_ARG (r); } @@ -100,7 +109,68 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Thread_Pool/run_test.pl b/TAO/tests/RTCORBA/Thread_Pool/run_test.pl index 309392e6c36..58e94e40b60 100755 --- a/TAO/tests/RTCORBA/Thread_Pool/run_test.pl +++ b/TAO/tests/RTCORBA/Thread_Pool/run_test.pl @@ -67,7 +67,6 @@ for $test (@configurations) $server = $SV->TimedWait (1); if ($server == 2) { - print STDOUT "Could not change priority levels. Check user permissions. Exiting...\n"; # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; exit $status; diff --git a/TAO/tests/RTCORBA/Thread_Pool/server.cpp b/TAO/tests/RTCORBA/Thread_Pool/server.cpp index 814b9fdb2d8..2ba5ec065ad 100644 --- a/TAO/tests/RTCORBA/Thread_Pool/server.cpp +++ b/TAO/tests/RTCORBA/Thread_Pool/server.cpp @@ -2,6 +2,8 @@ #include "test_i.h" #include "ace/Get_Opt.h" +#include "tao/ORB_Core.h" +#include "ace/Task.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "../check_supported_priorities.cpp" @@ -105,8 +107,8 @@ create_POA_and_register_servant (CORBA::Policy_ptr threadpool_policy, // Implicit_activation policy. policies[0] = root_poa->create_implicit_activation_policy - (PortableServer::IMPLICIT_ACTIVATION - ACE_ENV_ARG_PARAMETER); + (PortableServer::IMPLICIT_ACTIVATION + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); // Thread pool policy. @@ -158,25 +160,34 @@ create_POA_and_register_servant (CORBA::Policy_ptr threadpool_policy, return result; } +class Task : public ACE_Task_Base +{ +public: + + Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb); + + int svc (void); + + CORBA::ORB_var orb_; + +}; + +Task::Task (ACE_Thread_Manager &thread_manager, + CORBA::ORB_ptr orb) + : ACE_Task_Base (&thread_manager), + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + int -main (int argc, char *argv[]) +Task::svc (void) { ACE_TRY_NEW_ENV { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Make sure we can support multiple priorities that are required - // for this test. - check_supported_priorities (orb.in()); - CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RootPOA" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = @@ -189,8 +200,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTORB" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = @@ -199,8 +210,8 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; object = - orb->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::Current_var current = @@ -212,20 +223,15 @@ main (int argc, char *argv[]) current->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - int result = - parse_args (argc, argv); - if (result != 0) - return result; - - test_i servant (orb.in (), + test_i servant (this->orb_.in (), root_poa.in (), nap_time); test_var test = servant._this (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - result = - write_ior_to_file (orb.in (), + int result = + write_ior_to_file (this->orb_.in (), test.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -258,17 +264,13 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; CORBA::Boolean allow_borrowing = 0; - RTCORBA::ThreadpoolLanes lanes (2); - lanes.length (2); + RTCORBA::ThreadpoolLanes lanes (1); + lanes.length (1); lanes[0].lane_priority = default_thread_priority; lanes[0].static_threads = static_threads; lanes[0].dynamic_threads = dynamic_threads; - lanes[1].lane_priority = default_thread_priority; - lanes[1].static_threads = static_threads * 2; - lanes[1].dynamic_threads = dynamic_threads * 2; - RTCORBA::ThreadpoolId threadpool_id_2 = rt_orb->create_threadpool_with_lanes (stacksize, lanes, @@ -289,7 +291,7 @@ main (int argc, char *argv[]) "first_poa", poa_manager.in (), root_poa.in (), - orb.in (), + this->orb_.in (), rt_orb.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -301,24 +303,92 @@ main (int argc, char *argv[]) "second_poa", poa_manager.in (), root_poa.in (), - orb.in (), + this->orb_.in (), rt_orb.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result != 0) return result; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, + argv, + "" + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + int result = + parse_args (argc, argv); + if (result != 0) + return result; + + // Make sure we can support multiple priorities that are required + // for this test. + check_supported_priorities (orb.in()); + + // Thread Manager for managing task. + ACE_Thread_Manager thread_manager; + + // Create task. + Task task (thread_manager, + orb.in ()); + + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + orb->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + result = + task.activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. + ACE_ASSERT (0); + } + + // Wait for task to exit. + result = + thread_manager.wait (); + ACE_ASSERT (result != -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught"); + return -1; } ACE_ENDTRY; diff --git a/TAO/tests/RTCORBA/Thread_Pool/svc.conf b/TAO/tests/RTCORBA/Thread_Pool/svc.conf index 37973382e2c..2154375e265 100644 --- a/TAO/tests/RTCORBA/Thread_Pool/svc.conf +++ b/TAO/tests/RTCORBA/Thread_Pool/svc.conf @@ -1,2 +1,4 @@ -# Regular test -static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO" +# No options required for regular testing + +# For real-time testing, uncomment the following line: +# static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" diff --git a/TAO/tests/RTCORBA/Thread_Pool/svc.conf.xml b/TAO/tests/RTCORBA/Thread_Pool/svc.conf.xml new file mode 100644 index 00000000000..b589f90605b --- /dev/null +++ b/TAO/tests/RTCORBA/Thread_Pool/svc.conf.xml @@ -0,0 +1,7 @@ +<?xml version='1.0'?> +<!-- Converted from svc.conf by svcconf-convert.pl --> +<ACE_Svc_Conf> + <!-- No options required for regular testing --> + <!-- For real-time testing, uncomment the following line: --> + <!-- static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM" --> +</ACE_Svc_Conf> diff --git a/TAO/tests/RTCORBA/check_supported_priorities.cpp b/TAO/tests/RTCORBA/check_supported_priorities.cpp index 808bc1b84bc..3baa024ad80 100644 --- a/TAO/tests/RTCORBA/check_supported_priorities.cpp +++ b/TAO/tests/RTCORBA/check_supported_priorities.cpp @@ -3,21 +3,35 @@ #include "ace/Sched_Params.h" #include "tao/ORB_Core.h" +const char * +sched_policy_name (int sched_policy) +{ + const char *name; + + switch (sched_policy) + { + case ACE_SCHED_OTHER: + name = "SCHED_OTHER"; + break; + case ACE_SCHED_RR: + name = "SCHED_RR"; + break; + case ACE_SCHED_FIFO: + name = "SCHED_FIFO"; + break; + } + + return name; +} + void check_supported_priorities (CORBA::ORB_ptr orb) { - long current_policy = - orb->orb_core ()->orb_params ()->sched_policy (); - - // Conversion. - int sched_policy = ACE_SCHED_OTHER; - if (current_policy == THR_SCHED_FIFO) - sched_policy = ACE_SCHED_FIFO; - else if (current_policy == THR_SCHED_RR) - sched_policy = ACE_SCHED_RR; - - // Check that we have sufficient priority range to run this - // test, i.e., more than 1 priority level. + int sched_policy = + orb->orb_core ()->orb_params ()->ace_sched_policy (); + + // Check that we have sufficient priority range to run this test, + // i.e., more than 1 priority level. int max_priority = ACE_Sched_Params::priority_max (sched_policy); int min_priority = @@ -26,8 +40,11 @@ check_supported_priorities (CORBA::ORB_ptr orb) if (max_priority == min_priority) { ACE_DEBUG ((LM_DEBUG, - "Not enough priority levels on this platform" - " to run the test, aborting\n")); + "Not enough priority levels with the %s scheduling policy\n" + "on this platform to run the test, terminating program....\n" + "Check svc.conf options\n", + sched_policy_name (sched_policy))); + ACE_OS::exit (2); - } + } } diff --git a/TAO/tests/TAO_Tests.dsw b/TAO/tests/TAO_Tests.dsw index 532c8b5ed73..7bf247cb577 100644 --- a/TAO/tests/TAO_Tests.dsw +++ b/TAO/tests/TAO_Tests.dsw @@ -1389,6 +1389,18 @@ Package=<4> ###############################################################################
+Project: "POA Nested_Non_Servant_Upcalls"=.\POA\Nested_Non_Servant_Upcalls\Nested_Non_Servant_Upcalls.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "POA Non_Servant_Upcalls"=.\POA\Non_Servant_Upcalls\Non_Servant_Upcalls.dsp - Package Owner=<4>
Package=<5>
@@ -1683,6 +1683,7 @@ David Kinder <david.kinder@sophos.com> Sebastien Lalonde <SLalonde@interstarinc.com> Jia Wan <jiawan@huawei.com> Bertin Colpron <BColpron@interstarinc.com> +Weston Markham <wmarkham@tissueinformatics.com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile @@ -5863,8 +5863,6 @@ public: size_t stacksize = 0, ACE_Base_Thread_Adapter *thread_adapter = 0); - static int thr_getprio (ACE_hthread_t thr_id, - int &prio); static int thr_join (ACE_hthread_t waiter_id, ACE_THR_FUNC_RETURN *status); static int thr_join (ACE_thread_t waiter_id, @@ -5874,8 +5872,14 @@ public: int signum); static ACE_thread_t thr_self (void); static void thr_self (ACE_hthread_t &); - static int thr_setprio (ACE_hthread_t thr_id, - int prio, int thr_policy=-1); + static int thr_getprio (ACE_hthread_t id, + int &priority); + static int thr_getprio (ACE_hthread_t id, + int &priority, + int &policy); + static int thr_setprio (ACE_hthread_t id, + int priority, + int policy = -1); static int thr_setprio (const ACE_Sched_Priority prio); static int thr_suspend (ACE_hthread_t target_thread); static int thr_cancel (ACE_thread_t t_id); @@ -6472,18 +6472,19 @@ ACE_OS::thr_getconcurrency (void) } ACE_INLINE int -ACE_OS::thr_getprio (ACE_hthread_t thr_id, int &prio) +ACE_OS::thr_getprio (ACE_hthread_t id, int &priority, int &policy) { ACE_OS_TRACE ("ACE_OS::thr_getprio"); + ACE_UNUSED_ARG (policy); #if defined (ACE_HAS_THREADS) # if (defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_SETSCHED)) # if defined (ACE_HAS_PTHREADS_DRAFT4) int result; - result = ::pthread_getprio (thr_id); + result = ::pthread_getprio (id); if (result != -1) { - prio = result; + priority = result; return 0; } else @@ -6491,9 +6492,9 @@ ACE_OS::thr_getprio (ACE_hthread_t thr_id, int &prio) # elif defined (ACE_HAS_PTHREADS_DRAFT6) pthread_attr_t attr; - if (pthread_getschedattr (thr_id, &attr) == 0) + if (pthread_getschedattr (id, &attr) == 0) { - prio = pthread_attr_getprio(&attr); + priority = pthread_attr_getprio(&attr); return 0; } return -1; @@ -6501,39 +6502,46 @@ ACE_OS::thr_getprio (ACE_hthread_t thr_id, int &prio) struct sched_param param; int result; - int policy = 0; - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_getschedparam (thr_id, &policy, ¶m), + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_getschedparam (id, &policy, ¶m), result), int, -1, result); - prio = param.sched_priority; + priority = param.sched_priority; return result; # endif /* ACE_HAS_PTHREADS_DRAFT4 */ # elif defined (ACE_HAS_STHREADS) - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_getprio (thr_id, &prio), ace_result_), int, -1); + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_getprio (id, &priority), ace_result_), int, -1); # elif defined (ACE_HAS_WTHREADS) - prio = ::GetThreadPriority (thr_id); - if (prio == THREAD_PRIORITY_ERROR_RETURN) + priority = ::GetThreadPriority (id); + if (priority == THREAD_PRIORITY_ERROR_RETURN) ACE_FAIL_RETURN (-1); else return 0; # elif defined (ACE_PSOS) // passing a 0 in the second argument does not alter task priority, third arg gets existing one - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::t_setpri (thr_id, 0, (u_long *) &prio), ace_result_), int, -1); + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::t_setpri (id, 0, (u_long *) &priority), ace_result_), int, -1); # elif defined (VXWORKS) - ACE_OSCALL_RETURN (::taskPriorityGet (thr_id, &prio), int, -1); + ACE_OSCALL_RETURN (::taskPriorityGet (id, &priority), int, -1); # else - ACE_UNUSED_ARG (thr_id); - ACE_UNUSED_ARG (prio); + ACE_UNUSED_ARG (id); + ACE_UNUSED_ARG (priority); ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_STHREADS */ #else - ACE_UNUSED_ARG (thr_id); - ACE_UNUSED_ARG (prio); + ACE_UNUSED_ARG (id); + ACE_UNUSED_ARG (priority); ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ } +ACE_INLINE int +ACE_OS::thr_getprio (ACE_hthread_t id, int &priority) +{ + ACE_OS_TRACE ("ACE_OS::thr_getprio"); + int policy = 0; + return ACE_OS::thr_getprio (id, priority, policy); +} + #if defined (ACE_HAS_TSS_EMULATION) # if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) @@ -7280,72 +7288,71 @@ ACE_OS::thr_setconcurrency (int hint) } ACE_INLINE int -ACE_OS::thr_setprio (ACE_hthread_t thr_id, int prio, int thr_policy) +ACE_OS::thr_setprio (ACE_hthread_t id, int priority, int policy) { ACE_OS_TRACE ("ACE_OS::thr_setprio"); - ACE_UNUSED_ARG(thr_policy); + ACE_UNUSED_ARG (policy); #if defined (ACE_HAS_THREADS) # if (defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_SETSCHED)) # if defined (ACE_HAS_PTHREADS_DRAFT4) int result; - result = ::pthread_setprio(thr_id, prio); + result = ::pthread_setprio (id, priority); return (result == -1 ? -1 : 0); # elif defined (ACE_HAS_PTHREADS_DRAFT6) pthread_attr_t attr; - if (pthread_getschedattr (thr_id, &attr) == -1) + if (pthread_getschedattr (id, &attr) == -1) return -1; - if (pthread_attr_setprio (attr, prio) == -1) + if (pthread_attr_setprio (attr, priority) == -1) return -1; - return pthread_setschedattr (thr_id, attr); + return pthread_setschedattr (id, attr); # else - struct sched_param param; - int policy = 0; int result; + struct sched_param param; + memset ((void *) ¶m, 0, sizeof param); - ACE_ADAPT_RETVAL (::pthread_getschedparam (thr_id, &policy, ¶m), result); - if (result != 0) - result = -1; - - if (result == -1) - return result; // error in pthread_getschedparam - - /* if thr_policy is -1, we don't want to use it for pthread_setschedparam(). - Instead, use policy which was obtained from pthread_getschedparam() */ - if (thr_policy == -1) - thr_policy = policy; + // If <policy> is -1, we don't want to use it for + // pthread_setschedparam(). Instead, obtain policy from + // pthread_getschedparam(). + if (policy == -1) + { + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_getschedparam (id, &policy, ¶m), + result), + int, -1, result); + if (result == -1) + return result; + } - param.sched_priority = prio; - ACE_ADAPT_RETVAL (::pthread_setschedparam (thr_id, thr_policy, ¶m), result); - if (result != 0) - result = -1; + param.sched_priority = priority; - return result; + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_setschedparam (id, policy, ¶m), + ace_result_), + int, -1); # endif /* ACE_HAS_PTHREADS_DRAFT4 */ # elif defined (ACE_HAS_STHREADS) - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_setprio (thr_id, prio), + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_setprio (id, priority), ace_result_), int, -1); # elif defined (ACE_HAS_WTHREADS) - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetThreadPriority (thr_id, prio), + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetThreadPriority (id, priority), ace_result_), int, -1); # elif defined (ACE_PSOS) - u_long oldprio; - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::t_setpri (thr_id, prio, &oldprio), + u_long oldpriority; + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::t_setpri (id, priority, &oldpriority), ace_result_), int, -1); # elif defined (VXWORKS) - ACE_OSCALL_RETURN (::taskPrioritySet (thr_id, prio), int, -1); + ACE_OSCALL_RETURN (::taskPrioritySet (id, priority), int, -1); # else // For example, platforms that support Pthreads but LACK_SETSCHED. - ACE_UNUSED_ARG (thr_id); - ACE_UNUSED_ARG (prio); + ACE_UNUSED_ARG (id); + ACE_UNUSED_ARG (priority); ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_STHREADS */ #else - ACE_UNUSED_ARG (thr_id); - ACE_UNUSED_ARG (prio); + ACE_UNUSED_ARG (id); + ACE_UNUSED_ARG (priority); ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ } diff --git a/ace/Thread.h b/ace/Thread.h index 30cbc611097..48f960da386 100644 --- a/ace/Thread.h +++ b/ace/Thread.h @@ -147,10 +147,13 @@ public: static int suspend (ACE_hthread_t); /// Get the priority of a particular thread. - static int getprio (ACE_hthread_t, int &prio); + static int getprio (ACE_hthread_t id, int &priority); + + /// Get the priority and policy of a particular thread. + static int getprio (ACE_hthread_t id, int &priority, int &policy); /// Set the priority of a particular thread. - static int setprio (ACE_hthread_t, int prio); + static int setprio (ACE_hthread_t id, int priority, int policy = -1); /// Send a signal to the thread. static int kill (ACE_thread_t, int signum); diff --git a/ace/Thread.i b/ace/Thread.i index f678c47b336..0a489f873b9 100644 --- a/ace/Thread.i +++ b/ace/Thread.i @@ -10,11 +10,11 @@ ACE_INLINE int ACE_Thread::keycreate (ACE_thread_key_t *keyp, #if defined (ACE_HAS_THR_C_DEST) - ACE_THR_C_DEST destructor, + ACE_THR_C_DEST destructor, #else - ACE_THR_DEST destructor, + ACE_THR_DEST destructor, #endif /* ACE_HAS_THR_C_DEST */ - void *inst) + void *inst) { // ACE_TRACE ("ACE_Thread::keycreate"); return ACE_OS::thr_keycreate (keyp, destructor, inst); @@ -72,25 +72,25 @@ ACE_Thread::yield (void) ACE_INLINE int ACE_Thread::spawn (ACE_THR_FUNC func, - void *arg, - long flags, - ACE_thread_t *t_id, - ACE_hthread_t *t_handle, - long priority, - void *thr_stack, - size_t thr_stack_size, + void *arg, + long flags, + ACE_thread_t *t_id, + ACE_hthread_t *t_handle, + long priority, + void *thr_stack, + size_t thr_stack_size, ACE_Thread_Adapter *thread_adapter) { ACE_TRACE ("ACE_Thread::spawn"); return ACE_OS::thr_create (func, - arg, - flags, - t_id, - t_handle, - priority, - thr_stack, - thr_stack_size, + arg, + flags, + t_id, + t_handle, + priority, + thr_stack, + thr_stack_size, thread_adapter); } @@ -117,8 +117,8 @@ ACE_Thread::kill (ACE_thread_t t_id, int signum) ACE_INLINE int ACE_Thread::join (ACE_thread_t wait_for, - ACE_thread_t *departed, - ACE_THR_FUNC_RETURN *status) + ACE_thread_t *departed, + ACE_THR_FUNC_RETURN *status) { ACE_TRACE ("ACE_Thread::join"); return ACE_OS::thr_join (wait_for, departed, status); @@ -126,7 +126,7 @@ ACE_Thread::join (ACE_thread_t wait_for, ACE_INLINE int ACE_Thread::join (ACE_hthread_t wait_for, - ACE_THR_FUNC_RETURN *status) + ACE_THR_FUNC_RETURN *status) { ACE_TRACE ("ACE_Thread::join"); return ACE_OS::thr_join (wait_for, status); @@ -148,8 +148,8 @@ ACE_Thread::setconcurrency (int new_level) ACE_INLINE int ACE_Thread::sigsetmask (int how, - const sigset_t *sigset, - sigset_t *osigset) + const sigset_t *sigset, + sigset_t *osigset) { ACE_TRACE ("ACE_Thread::sigsetmask"); return ACE_OS::thr_sigsetmask (how, sigset, osigset); @@ -175,7 +175,7 @@ ACE_Thread::disablecancel (struct cancel_state *old_state) ACE_INLINE int ACE_Thread::enablecancel (struct cancel_state *old_state, - int flag) + int flag) { ACE_TRACE ("ACE_Thread::enablecancel"); int old_cstate = 0; @@ -203,7 +203,7 @@ ACE_Thread::enablecancel (struct cancel_state *old_state, ACE_INLINE int ACE_Thread::setcancelstate (struct cancel_state &new_state, - struct cancel_state *old_state) + struct cancel_state *old_state) { ACE_TRACE ("ACE_Thread::setcancelstate"); int old_cstate = 0; @@ -211,17 +211,17 @@ ACE_Thread::setcancelstate (struct cancel_state &new_state, if (new_state.cancelstate != 0 && ACE_OS::thr_setcancelstate (new_state.cancelstate, - &old_cstate) != 0) + &old_cstate) != 0) return -1; if (new_state.canceltype != 0 && ACE_OS::thr_setcanceltype (new_state.canceltype, - &old_ctype) != 0) + &old_ctype) != 0) { int o_cstate; ACE_OS::thr_setcancelstate (old_cstate, - &o_cstate); + &o_cstate); return -1; } @@ -258,15 +258,22 @@ ACE_Thread::self (ACE_hthread_t &t_id) } ACE_INLINE int -ACE_Thread::getprio (ACE_hthread_t t_id, int &prio) +ACE_Thread::getprio (ACE_hthread_t id, int &priority) { ACE_TRACE ("ACE_Thread::getprio"); - return ACE_OS::thr_getprio (t_id, prio); + return ACE_OS::thr_getprio (id, priority); } ACE_INLINE int -ACE_Thread::setprio (ACE_hthread_t t_id, int prio) +ACE_Thread::getprio (ACE_hthread_t id, int &priority, int &policy) +{ + ACE_TRACE ("ACE_Thread::getprio"); + return ACE_OS::thr_getprio (id, priority, policy); +} + +ACE_INLINE int +ACE_Thread::setprio (ACE_hthread_t id, int priority, int policy) { ACE_TRACE ("ACE_Thread::setprio"); - return ACE_OS::thr_setprio (t_id, prio); + return ACE_OS::thr_setprio (id, priority, policy); } diff --git a/bin/tao_orb_tests.lst b/bin/tao_orb_tests.lst index f0dccdc676a..2b9ea9f1c9f 100644 --- a/bin/tao_orb_tests.lst +++ b/bin/tao_orb_tests.lst @@ -29,23 +29,24 @@ TAO/tests/Bug_1020_Basic_Regression/run_test.pl: !Win32 !MINIMUM !ST TAO/tests/Bug_1020_Regression/run_test.pl: !MINIMUM !ST !Win32 TAO/tests/Bug_1361_Regression/run_test.pl: !MINIMUM !ST !Win32 TAO/tests/Bug_1482_Regression/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Banded_Connections/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Client_Propagated/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Client_Protocol/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Collocation/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Destroy_Thread_Pool/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Explicit_Binding/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Linear_Priority/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/ORB_init/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Persistent_IOR/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Policy_Combinations/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Private_Connection/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl: !MINIMUM !ST !Linux +TAO/tests/RTCORBA/Banded_Connections/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Client_Propagated/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Client_Protocol/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Collocation/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Destroy_Thread_Pool/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Explicit_Binding/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Linear_Priority/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/ORB_init/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Persistent_IOR/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Policies/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Policy_Combinations/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Private_Connection/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl: !MINIMUM !ST TAO/tests/RTCORBA/RTMutex/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Server_Declared/run_test.pl: !MINIMUM !ST !Linux -TAO/tests/RTCORBA/Server_Protocol/run_test.pl: !MINIMUM !ST -TAO/tests/RTCORBA/Thread_Pool/run_test.pl: !MINIMUM !ST !Linux +TAO/tests/RTCORBA/Server_Declared/run_test.pl: !MINIMUM !ST +TAO/tests/RTCORBA/Server_Protocol/run_test.pl: !MINIMUM +TAO/tests/RTCORBA/Thread_Pool/run_test.pl: !MINIMUM !ST TAO/tests/Hello/run_test.pl TAO/tests/Cache_Growth_Test/run_test.pl TAO/tests/Muxing/run_test.pl: !ST @@ -78,6 +79,7 @@ TAO/tests/POA/Default_Servant/run_test.pl: !MINIMUM TAO/tests/POA/Single_Threaded_POA/run_test.pl: !MINIMUM !ST TAO/tests/POA/Non_Servant_Upcalls/run_test.pl: !SUNCC5_1 TAO/tests/POA/MT_Servant_Locator/run_test.pl: !MINIMUM !ST +TAO/tests/POA/Nested_Non_Servant_Upcalls/run_test.pl: !MINIMUM !ST TAO/tests/POA/Current/run_test.pl TAO/tests/POA/wait_for_completion/run_test.pl TAO/tests/IORManipulation/run_test.pl |