diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FaultTolerance')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp | 17 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h | 6 |
2 files changed, 16 insertions, 7 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp index 16ada0ae26e..02dec8e7aaa 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp @@ -19,12 +19,17 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_FT_Service_Callbacks::TAO_FT_Service_Callbacks (TAO_ORB_Core *orb_core) - : orb_core_ (orb_core) + : orb_core_ (orb_core), + profile_lock_ (0) { + this->profile_lock_ = + this->orb_core_->client_factory ()->create_profile_lock (); } TAO_FT_Service_Callbacks::~TAO_FT_Service_Callbacks (void) { + // Delete the memeory for the lock + delete this->profile_lock_; } CORBA::Boolean @@ -198,7 +203,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; @@ -208,9 +213,9 @@ 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 (), + *stub->profile_lock (), 0)); // even now, the forward profiles might have been deleted in the meanwhile @@ -229,9 +234,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/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h index d2685042f83..de694bb723c 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h @@ -50,7 +50,7 @@ public: virtual ~TAO_FT_Service_Callbacks (void); /// Select the profile from MProfile as the needs of the services - /// may be. Return the profile in @a pfile + /// may be. Return the profile in <pfile> virtual CORBA::Boolean select_profile (const TAO_MProfile &mprofile, TAO_Profile *&pfile); @@ -97,6 +97,10 @@ private: private: /// The ORB core in which we have been activated TAO_ORB_Core *orb_core_; + + /// Mutex to protect access to the profile that gets passed along + /// @@ Lock needs to be removed... + ACE_Lock* profile_lock_; }; TAO_END_VERSIONED_NAMESPACE_DECL |