diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-07 09:15:25 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-07 09:15:25 +0000 |
commit | 2fc70c1eb9f6748fa62af32227374baa0ff54997 (patch) | |
tree | 980a8913809a35d0c29ce9d1cc21fee9ee1447b4 | |
parent | 71fab242995b8ffbece53eaa619776543fd73171 (diff) | |
download | ATCD-2fc70c1eb9f6748fa62af32227374baa0ff54997.tar.gz |
Mon Mar 7 09:10:25 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp:
* tao/Stub.h:
* tao/Stub.inl:
* tao/Stub.cpp:
ImR example again broke, need to sort this out later
-rw-r--r-- | TAO/ChangeLog | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Stub.cpp | 21 | ||||
-rw-r--r-- | TAO/tao/Stub.h | 9 | ||||
-rw-r--r-- | TAO/tao/Stub.inl | 31 |
5 files changed, 44 insertions, 33 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 13c998a8f23..612913b119e 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,11 @@ +Mon Mar 7 09:10:25 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp: + * tao/Stub.h: + * tao/Stub.inl: + * tao/Stub.cpp: + ImR example again broke, need to sort this out later + Sun Mar 6 10:07:28 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> * orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp: diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp index 7b828bf738d..c889f4f1ffb 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp @@ -197,7 +197,7 @@ TAO_FT_Service_Callbacks::is_permanent_forward_condition (const CORBA::Object_pt sc.context_id = IOP::FT_GROUP_VERSION; if (service_context.get_context (sc) == 0) - return false; + return false; /* false */ IOP::TaggedComponent tc; tc.tag = IOP::TAG_FT_GROUP; @@ -207,7 +207,7 @@ TAO_FT_Service_Callbacks::is_permanent_forward_condition (const CORBA::Object_pt if (stub->forward_profiles ()) { // set lock, as forward_profiles might be deleted concurrently - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, *stub->profile_lock (), 0)); @@ -228,9 +228,9 @@ TAO_FT_Service_Callbacks::is_permanent_forward_condition (const CORBA::Object_pt if (tagged_components.get_component (tc) == 0) // releasing lock - return false; + return false; /* false */ - return true; + return true; /* true */ // releasing lock } diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 731ee16ed57..a983f392794 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -43,7 +43,7 @@ TAO_Stub::TAO_Stub (const char *repository_id, , forward_profiles_ (0) , forward_profiles_perm_ (0) , profile_in_use_ (0) - , profile_lock_ (0) + , profile_lock_ptr_ (0) , profile_success_ (false) , refcount_ (1) #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -74,7 +74,8 @@ TAO_Stub::TAO_Stub (const char *repository_id, // Cache the ORB pointer to respond faster to certain queries. this->orb_ = CORBA::ORB::_duplicate (this->orb_core_->orb ()); - this->profile_lock_ = new TAO_SYNCH_MUTEX; + this->profile_lock_ptr_ = + this->orb_core_->client_factory ()->create_profile_lock (); this->base_profiles (profiles); } @@ -96,7 +97,7 @@ TAO_Stub::~TAO_Stub (void) this->profile_in_use_ = 0; } - delete this->profile_lock_; + delete this->profile_lock_ptr_; #if (TAO_HAS_CORBA_MESSAGING == 1) delete this->policies_; @@ -113,9 +114,9 @@ TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles, { // we assume that the profile_in_use_ is being // forwarded! Grab the lock so things don't change. - ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD (ACE_Lock, guard, - *this->profile_lock_)); + *this->profile_lock_ptr_)); if (permanent_forward) { @@ -155,9 +156,9 @@ TAO_Stub::create_ior_info (IOP::IOR *&ior_info, CORBA::ULong &index) { // We are creating the IOR info. Let us not be disturbed. So grab a // lock. - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, - *this->profile_lock_, + *this->profile_lock_ptr_, -1)); IOP::IOR *tmp_info = 0; @@ -223,7 +224,7 @@ TAO_Stub::object_key (void) const { // Double-checked // FUZZ: disable check_for_ACE_Guard - ACE_Guard<TAO_SYNCH_MUTEX> obj (*this->profile_lock_); + ACE_Guard<ACE_Lock> obj (*this->profile_lock_ptr_); // FUZZ: enable check_for_ACE_Guard if (obj.locked () != 0 && this->forward_profiles_ != 0) @@ -516,9 +517,9 @@ TAO_Stub::marshal (TAO_OutputCDR &cdr) } else { - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, - *this->profile_lock_, + *this->profile_lock_ptr_, 0)); ACE_ASSERT(this->forward_profiles_ !=0); diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index 9080fa9e93b..66bb2ed25ce 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -118,7 +118,7 @@ public: /// Return the Profile lock. This lock can be used at places where /// profiles need to be edited. - TAO_SYNCH_MUTEX *profile_lock (void) const; + ACE_Lock *profile_lock (void) const; /// Manage the base (non-forwarded) profiles. /// Returns a pointer to the profile_in_use object. This object @@ -369,7 +369,7 @@ protected: TAO_Profile *profile_in_use_; /// Mutex to protect access to the forwarding profile. - TAO_SYNCH_MUTEX* profile_lock_; + ACE_Lock* profile_lock_ptr_; /// Have we successfully talked to the forward profile yet? CORBA::Boolean profile_success_; @@ -403,8 +403,9 @@ protected: */ CORBA::Boolean const collocation_opt_; - /// True if forwarding request upon some specific exceptions - /// (e.g. OBJECT_NOT_EXIST) already happened. + + // True if forwarding request upon some specific exceptions + // (e.g. OBJECT_NOT_EXIST) already happened. ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> forwarded_on_exception_; }; diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl index 2ef29264cbc..a0ecaed898c 100644 --- a/TAO/tao/Stub.inl +++ b/TAO/tao/Stub.inl @@ -1,17 +1,11 @@ // -*- C++ -*- +// // $Id$ #include "tao/ORB_Core.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_INLINE -TAO_SYNCH_MUTEX* -TAO_Stub::profile_lock () const -{ - return this->profile_lock_; -} - ACE_INLINE void TAO_Stub::reset_base (void) { @@ -22,6 +16,12 @@ TAO_Stub::reset_base (void) } +ACE_INLINE ACE_Lock* +TAO_Stub::profile_lock (void) const +{ + return this->profile_lock_ptr_; +} + ACE_INLINE void TAO_Stub::reset_forward (void) { @@ -53,9 +53,9 @@ TAO_Stub::reset_profiles_i (void) ACE_INLINE void TAO_Stub::reset_profiles (void) { - ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD (ACE_Lock, guard, - *this->profile_lock_)); + *this->profile_lock_ptr_)); this->reset_profiles_i (); } @@ -156,9 +156,9 @@ TAO_Stub::next_profile_i (void) ACE_INLINE TAO_Profile * TAO_Stub::next_profile (void) { - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, - *this->profile_lock_, + *this->profile_lock_ptr_, 0)); return this->next_profile_i (); } @@ -184,9 +184,9 @@ TAO_Stub::valid_profile (void) const ACE_INLINE TAO_Profile * TAO_Stub::base_profiles (const TAO_MProfile &mprofiles) { - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, - *this->profile_lock_, + *this->profile_lock_ptr_, 0)); // first reset things so we start from scratch! @@ -204,9 +204,9 @@ TAO_Stub::base_profiles (const TAO_MProfile &mprofiles) ACE_INLINE CORBA::Boolean TAO_Stub::next_profile_retry (void) { - ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, - *this->profile_lock_, + *this->profile_lock_ptr_, 0)); if (this->profile_success_ && this->forward_profiles_) @@ -347,6 +347,7 @@ bool TAO_Stub::forwarded_on_exception () const return forwarded_on_exception_.value (); } + // --------------------------------------------------------------- // Creator methods for TAO_Stub_Auto_Ptr (TAO_Stub Auto Pointer) |