00001 // -*- C++ -*- 00002 // 00003 // $Id: Policy_Manager.inl 79118 2007-07-31 11:38:01Z johnnyw $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 TAO_Policy_Manager::TAO_Policy_Manager (void) 00009 : impl_ (TAO_POLICY_ORB_SCOPE) 00010 { 00011 } 00012 00013 ACE_INLINE CORBA::Policy_ptr 00014 TAO_Policy_Manager::get_policy (CORBA::PolicyType policy) 00015 { 00016 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); 00017 return this->impl_.get_policy (policy); 00018 } 00019 00020 ACE_INLINE CORBA::Policy_ptr 00021 TAO_Policy_Manager::get_cached_policy (TAO_Cached_Policy_Type type) 00022 { 00023 // @@ Previous code used a "double-checked locking hack" to check 00024 // if the policy was set before grabbing the lock to actually get 00025 // it, so that could save a lock operation. This was removed, as 00026 // it is not as easy to do this anymore. 00027 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); 00028 00029 return this->impl_.get_cached_policy (type); 00030 } 00031 00032 TAO_END_VERSIONED_NAMESPACE_DECL