From 7a5e82dca329e2dc09c972b58fa9a3c9cf1a1131 Mon Sep 17 00:00:00 2001 From: yamuna Date: Mon, 30 Jun 2003 20:03:29 +0000 Subject: ChangelogTag: Mon Jun 30 04:02:55 2003 Yamuna Krishnamurthy --- TAO/tao/RTScheduling/Current.cpp | 70 +++++++++++++--------------- TAO/tao/RTScheduling/Current.h | 24 +++++----- TAO/tao/RTScheduling/Distributable_Thread.h | 4 +- TAO/tao/RTScheduling/Request_Interceptor.cpp | 4 +- TAO/tao/RTScheduling/Request_Interceptor.h | 24 +++++----- 5 files changed, 62 insertions(+), 64 deletions(-) diff --git a/TAO/tao/RTScheduling/Current.cpp b/TAO/tao/RTScheduling/Current.cpp index 39d336f9ecc..546bf6f373b 100644 --- a/TAO/tao/RTScheduling/Current.cpp +++ b/TAO/tao/RTScheduling/Current.cpp @@ -7,7 +7,6 @@ //#include "ThreadAction.h" - ACE_Atomic_Op guid_counter; u_long @@ -17,9 +16,17 @@ TAO_DTId_Hash::operator () (const IdType &id) const id.length ()); } -TAO_RTScheduler_Current::TAO_RTScheduler_Current (TAO_ORB_Core* orb) - : orb_ (orb) +TAO_RTScheduler_Current::TAO_RTScheduler_Current (void) { +} + + +void +TAO_RTScheduler_Current::init (TAO_ORB_Core* orb + ACE_ENV_ARG_DECL) +{ + this->orb_ = orb; + // Create the RT_Current. RTCORBA::Current_ptr current; ACE_NEW_THROW_EX (current, @@ -32,7 +39,6 @@ TAO_RTScheduler_Current::TAO_RTScheduler_Current (TAO_ORB_Core* orb) this->rt_current_ = current; } - void TAO_RTScheduler_Current::rt_current (RTCORBA::Current_ptr rt_current) { @@ -130,8 +136,7 @@ TAO_RTScheduler_Current::end_scheduling_segment (const char * name } RTScheduling::DistributableThread_ptr -TAO_RTScheduler_Current::lookup(const RTScheduling::Current::IdType & id - ACE_ENV_ARG_DECL) +TAO_RTScheduler_Current::lookup(const RTScheduling::Current::IdType & id) ACE_THROW_SPEC ((CORBA::SystemException)) { RTScheduling::DistributableThread_var DT; @@ -188,6 +193,7 @@ CORBA::Policy_ptr TAO_RTScheduler_Current::scheduling_parameter (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + TAO_RTScheduler_Current_i *impl = this->implementation (); if (impl == 0) @@ -532,38 +538,27 @@ TAO_RTScheduler_Current_i::spawn (RTScheduling::ThreadAction_ptr start, RTScheduling::DistributableThread_var dt = TAO_DistributableThread_Factory::create_DT (); TAO_RTScheduler_Current_i *new_current; - ACE_NEW_THROW_EX (new_current, - TAO_RTScheduler_Current_i (this->orb_, - this->dt_hash_), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); + ACE_NEW_RETURN (new_current, + TAO_RTScheduler_Current_i (this->orb_, + this->dt_hash_), + 0); ACE_CHECK; new_current->DT (dt.in ()); - ACE_NEW_THROW_EX (dttask, - DTTask (//thread_manager_, - this->orb_, - this->dt_hash_, - new_current, - start, - data, - name, - sched_param, - implicit_sched_param), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO) - ); + ACE_NEW_RETURN (dttask, + DTTask (//thread_manager_, + this->orb_, + this->dt_hash_, + new_current, + start, + data, + name, + sched_param, + implicit_sched_param), + 0); ACE_CHECK; - - - + if (dttask->activate_task (base_priority, stack_size) == -1) { @@ -589,13 +584,13 @@ DTTask::activate_task (RTCORBA::Priority base_priority, this->orb_->orb_params ()->sched_policy (); CORBA::Object_var object = this->orb_->object_ref_table ().resolve_initial_references ("PriorityMappingManager" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (-1); + RTCORBA::PriorityMappingManager_var mapping_manager = RTCORBA::PriorityMappingManager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_CHECK_RETURN (-1); RTCORBA::PriorityMapping *pm = mapping_manager->mapping (); @@ -688,6 +683,7 @@ RTScheduling::Current::IdType * TAO_RTScheduler_Current_i::id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + RTScheduling::Current::IdType_var guid = this->guid_; return guid._retn (); } diff --git a/TAO/tao/RTScheduling/Current.h b/TAO/tao/RTScheduling/Current.h index be1009bcb2b..21c4b4cb0ba 100644 --- a/TAO/tao/RTScheduling/Current.h +++ b/TAO/tao/RTScheduling/Current.h @@ -54,9 +54,11 @@ public RTScheduling::Current, { public: - TAO_RTScheduler_Current (TAO_ORB_Core*); - - + TAO_RTScheduler_Current (void); + + void init (TAO_ORB_Core* orb + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + virtual RTCORBA::Priority the_priority (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -88,8 +90,7 @@ public RTScheduling::Current, ACE_THROW_SPEC ((CORBA::SystemException)); virtual RTScheduling::DistributableThread_ptr - lookup(const RTScheduling::Current::IdType & id - ACE_ENV_ARG_DECL) + lookup(const RTScheduling::Current::IdType & id) ACE_THROW_SPEC ((CORBA::SystemException)); // returns a null reference if @@ -272,18 +273,18 @@ class TAO_RTScheduler_Export TAO_RTScheduler_Current_i ACE_THROW_SPEC ((CORBA::SystemException)); virtual RTScheduling::Current::IdType * - id (ACE_ENV_SINGLE_ARG_DECL) + id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); void id (RTScheduling::Current::IdType guid ); virtual CORBA::Policy_ptr - scheduling_parameter (ACE_ENV_SINGLE_ARG_DECL) + scheduling_parameter (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); virtual CORBA::Policy_ptr - implicit_scheduling_parameter (ACE_ENV_SINGLE_ARG_DECL) + implicit_scheduling_parameter (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -292,7 +293,7 @@ class TAO_RTScheduler_Export TAO_RTScheduler_Current_i void implicit_scheduling_parameter (CORBA::Policy_ptr); virtual RTScheduling::Current::NameList * - current_scheduling_segment_names (ACE_ENV_SINGLE_ARG_DECL) + current_scheduling_segment_names (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); void cancel_thread (ACE_ENV_SINGLE_ARG_DECL) @@ -343,8 +344,9 @@ public: CORBA::Policy_ptr implicit_sched_param); int activate_task (RTCORBA::Priority base_priority, - CORBA::ULong stack_size); - + CORBA::ULong stack_size + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + virtual int svc (void); private: diff --git a/TAO/tao/RTScheduling/Distributable_Thread.h b/TAO/tao/RTScheduling/Distributable_Thread.h index 81f38d59b78..ee84496c1bb 100644 --- a/TAO/tao/RTScheduling/Distributable_Thread.h +++ b/TAO/tao/RTScheduling/Distributable_Thread.h @@ -14,11 +14,11 @@ class TAO_RTScheduler_Export TAO_DistributableThread ~TAO_DistributableThread (void); - virtual void cancel (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual void cancel (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual RTScheduling::DistributableThread::DT_State state (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual RTScheduling::DistributableThread::DT_State state (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); private: diff --git a/TAO/tao/RTScheduling/Request_Interceptor.cpp b/TAO/tao/RTScheduling/Request_Interceptor.cpp index ad43a2d1acd..183c940e727 100644 --- a/TAO/tao/RTScheduling/Request_Interceptor.cpp +++ b/TAO/tao/RTScheduling/Request_Interceptor.cpp @@ -182,7 +182,7 @@ Client_Interceptor::receive_exception (PortableInterceptor::ClientRequestInfo_pt { // Perform the necessary cleanup as the // thread was cancelled. - current->cancel_thread (); + current->cancel_thread (ACE_ENV_SINGLE_ARG_PARAMETER); } else { @@ -342,7 +342,7 @@ Server_Interceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri { if (current->DT ()->state () == RTScheduling::DistributableThread::CANCELLED) { - current->cancel_thread (ACE_ENV_ARG_PARAMETER); + current->cancel_thread (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } diff --git a/TAO/tao/RTScheduling/Request_Interceptor.h b/TAO/tao/RTScheduling/Request_Interceptor.h index dc54aa2d12e..1cbba802e98 100644 --- a/TAO/tao/RTScheduling/Request_Interceptor.h +++ b/TAO/tao/RTScheduling/Request_Interceptor.h @@ -25,11 +25,11 @@ public: PortableInterceptor::ForwardRequest)); virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri @@ -38,14 +38,14 @@ public: PortableInterceptor::ForwardRequest)); virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ForwardRequest)); - virtual char* name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual char* name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); static IOP::ServiceId SchedulingInfo; @@ -57,10 +57,10 @@ public PortableInterceptor::ServerRequestInterceptor { public: - Server_Interceptor (TAO_RTScheduler_Current_ptr current); - + Server_Interceptor (TAO_RTScheduler_Current_ptr current); + virtual void receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ForwardRequest)); @@ -74,19 +74,19 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ForwardRequest)); virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ForwardRequest)); - virtual char* name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual char* name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); static IOP::ServiceId SchedulingInfo; -- cgit v1.2.1