diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-03-04 16:32:13 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-03-04 16:32:13 +0000 |
commit | 91fc5404f38d42da152e64f44619ef15df42ee11 (patch) | |
tree | 9e6149c2d1d3cd8a8117368ec817517eb48bac8b /TAO | |
parent | ed8d1685a76a128c4615d7e96d0f84e4b7315df5 (diff) | |
download | ATCD-91fc5404f38d42da152e64f44619ef15df42ee11.tar.gz |
ChangeLogTag:Mon Mar 04 11:30:06 2002 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp | 30 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Makefile | 22 |
6 files changed, 59 insertions, 25 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 9403e806277..1b2b889a06c 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,18 @@ +Mon Mar 04 11:30:06 2002 Carlos O'Ryan <coryan@uci.edu> + + * orbsvcs/orbsvcs/Makefile: + Enable RTCORBAEvent by default. + + * orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp: + Fixed initialization + + * orbsvcs/orbsvcs/Event/EC_Event_Channel.h: + * orbsvcs/orbsvcs/Event/EC_Event_Channel.i: + * orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp: + Keep track of the event channel status (IDLE -> ACTIVE -> + DESTROYED). This is important for applications and tests that + need to shutdown when the event channel has been destroyed. + Mon Mar 4 09:14:36 2002 Balachandran Natarajan <bala@cs.wustl.edu> * orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.inl: Fixed diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp index fac6bcc9996..1de5de3116c 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp @@ -30,7 +30,7 @@ TAO_EC_Event_Channel (const TAO_EC_Event_Channel_Attributes& attr, disconnect_callbacks_ (attr.disconnect_callbacks), busy_hwm_ (attr.busy_hwm), max_write_delay_ (attr.max_write_delay) - , destroyed_ (0) + , status_ (EC_S_IDLE) { if (this->factory_ == 0) { @@ -104,20 +104,37 @@ TAO_EC_Event_Channel::~TAO_EC_Event_Channel (void) void TAO_EC_Event_Channel::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) { + { + // First check if the EC is idle, if it is not then we need to + // return right away... + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); + if (this->status_ != EC_S_IDLE) + return; + this->status_ = EC_S_ACTIVATING; + } this->dispatching_->activate (); this->timeout_generator_->activate (); this->consumer_control_->activate (); this->supplier_control_->activate (); + { + // Only when all the operations complete successfully we can mark + // the EC as active... + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_ASSERT (this->status_ == EC_S_ACTIVATING); + this->status_ = EC_S_ACTIVE; + } } void TAO_EC_Event_Channel::shutdown (ACE_ENV_SINGLE_ARG_DECL) { { + // First check if the EC is already active, if it is not then we + // need to return right away... ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); - if (this->destroyed_) + if (this->status_ != EC_S_ACTIVE) return; - this->destroyed_ = 1; + this->status_ = EC_S_DESTROYING; } this->dispatching_->shutdown (); this->timeout_generator_->shutdown (); @@ -148,6 +165,13 @@ TAO_EC_Event_Channel::shutdown (ACE_ENV_SINGLE_ARG_DECL) this->consumer_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; + { + // Wait until all the shutdown() operations return before marking + // the EC as destroyed... + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); + ACE_ASSERT (this->status_ == EC_S_DESTROYING); + this->status_ = EC_S_DESTROYED; + } } void diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h index 9544ae89858..e67dea2f8c9 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h @@ -324,8 +324,15 @@ private: /// Mutex to protect the internal state TAO_SYNCH_MUTEX mutex_; - /// Flag to check if the event channel has been destroyed already - int destroyed_; + /// Flag to track the status of the event channel + enum { + EC_S_IDLE + , EC_S_ACTIVATING + , EC_S_ACTIVE + , EC_S_DESTROYING + , EC_S_DESTROYED + }; + int status_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i index f8e171fcc2d..4e3b104a717 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i @@ -193,5 +193,5 @@ ACE_INLINE int TAO_EC_Event_Channel::destroyed (void) { ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->destroyed_; -} + return (this->status_ == EC_S_DESTROYED); +} diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp index 798d6249c39..5bb7b19a19b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp @@ -19,7 +19,7 @@ TAO_EC_RTCORBA_Dispatching:: { ACE_NEW (this->tasks_, TAO_EC_Dispatching_Task[this->lanes_.length ()]); for (CORBA::ULong i = 0; i != this->lanes_.length (); ++i) - this->tasks_->thr_mgr (&this->thread_manager_); + this->tasks_[i].thr_mgr (&this->thread_manager_); } TAO_EC_RTCORBA_Dispatching::~TAO_EC_RTCORBA_Dispatching (void) diff --git a/TAO/orbsvcs/orbsvcs/Makefile b/TAO/orbsvcs/orbsvcs/Makefile index b497ba3510c..d292431ecf9 100644 --- a/TAO/orbsvcs/orbsvcs/Makefile +++ b/TAO/orbsvcs/orbsvcs/Makefile @@ -62,6 +62,8 @@ ifndef TAO_ORBSVCS # which are disabled by Minimum CORBA. TAO_ORBSVCS += PortableGroup + TAO_ORBSVCS += RTCORBAEvent + endif # minimum_corba ifeq ($(ssl),1) @@ -113,12 +115,6 @@ ifneq (,$(findstring RTEvent, $(TAO_ORBSVCS))) MKLIST += Makefile.RTEvent endif endif -# Backwards compatibility, going away soon. -ifneq (,$(findstring Event2, $(TAO_ORBSVCS))) - ifeq (,$(findstring Makefile.RTEvent, $(MKLIST))) - MKLIST += Makefile.RTEvent - endif -endif ifneq (,$(findstring Sched, $(TAO_ORBSVCS))) MKLIST += Makefile.RTSched endif @@ -133,17 +129,6 @@ ifneq (,$(findstring Event, $(TAO_ORBSVCS))) MKLIST += Makefile.RTOLDEvent endif endif -ifneq (,$(findstring Event, $(TAO_ORBSVCS))) - ifeq (,$(findstring Makefile.RTEvent, $(MKLIST))) - MKLIST += Makefile.RTEvent - endif - ifeq (,$(findstring Makefile.RTSched, $(MKLIST))) - MKLIST += Makefile.RTSched - endif - ifeq (,$(findstring Makefile.RTOLDEvent, $(MKLIST))) - MKLIST += Makefile.RTOLDEvent - endif -endif ifneq (,$(findstring RTOLDEvent, $(TAO_ORBSVCS))) ifeq (,$(findstring Makefile.RTOLDEvent, $(MKLIST))) MKLIST += Makefile.RTOLDEvent @@ -152,6 +137,9 @@ endif ifneq (,$(findstring RTSchedEvent, $(TAO_ORBSVCS))) MKLIST += Makefile.RTSchedEvent endif +ifneq (,$(findstring RTCORBAEvent, $(TAO_ORBSVCS))) + MKLIST += Makefile.RTCORBAEvent +endif ifneq (,$(findstring CosEvent, $(TAO_ORBSVCS))) MKLIST += Makefile.CosEvent endif |