Kaydet (Commit) 2bc96c37 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

INTEGRATION: CWS configrefactor01 (1.4.84); FILE MERGED

2007/01/11 20:16:00 mmeeks 1.4.84.1: Submitted by: mmeeks
More re-factoring, lots of locking rationalized, drastically reduced
the mutex count, also removed ~300k interlocked increments with a non-interlocking
SimpleReferencedObject base
üst b7dd974e
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: autoreferencemap.hxx,v $ * $RCSfile: autoreferencemap.hxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 03:42:36 $ * last change: $Author: ihi $ $Date: 2007-11-23 14:15:08 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -36,13 +36,9 @@ ...@@ -36,13 +36,9 @@
#ifndef CONFIGMGR_AUTOREFERENCEMAP_HXX #ifndef CONFIGMGR_AUTOREFERENCEMAP_HXX
#define CONFIGMGR_AUTOREFERENCEMAP_HXX #define CONFIGMGR_AUTOREFERENCEMAP_HXX
#ifndef _OSL_MUTEX_HXX_
#include <osl/mutex.hxx>
#endif
#ifndef _RTL_REF_HXX_ #ifndef _RTL_REF_HXX_
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#endif #endif
#ifndef INCLUDED_MAP #ifndef INCLUDED_MAP
#include <map> #include <map>
#define INCLUDED_MAP #define INCLUDED_MAP
...@@ -91,7 +87,6 @@ namespace configmgr ...@@ -91,7 +87,6 @@ namespace configmgr
Ref insert(Key const & _aKey, Ref const & _anEntry); Ref insert(Key const & _aKey, Ref const & _anEntry);
Ref remove(Key const & _aKey); Ref remove(Key const & _aKey);
osl::Mutex & mutex() const { return m_aMutex; }
private: private:
Ref internalGet(Key const & _aKey) const Ref internalGet(Key const & _aKey) const
{ {
...@@ -110,7 +105,6 @@ namespace configmgr ...@@ -110,7 +105,6 @@ namespace configmgr
m_aMap.erase(_aKey); m_aMap.erase(_aKey);
} }
private: private:
mutable osl::Mutex m_aMutex;
Map m_aMap; Map m_aMap;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -118,7 +112,6 @@ namespace configmgr ...@@ -118,7 +112,6 @@ namespace configmgr
template < class Key, class Object, class KeyCompare > template < class Key, class Object, class KeyCompare >
bool AutoReferenceMap<Key,Object,KeyCompare>::has(Key const & _aKey) const bool AutoReferenceMap<Key,Object,KeyCompare>::has(Key const & _aKey) const
{ {
osl::MutexGuard aGuard(m_aMutex);
return internalGet(_aKey).is(); return internalGet(_aKey).is();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -126,7 +119,6 @@ namespace configmgr ...@@ -126,7 +119,6 @@ namespace configmgr
template < class Key, class Object, class KeyCompare > template < class Key, class Object, class KeyCompare >
rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::get(Key const & _aKey) const rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::get(Key const & _aKey) const
{ {
osl::MutexGuard aGuard(m_aMutex);
return internalGet(_aKey); return internalGet(_aKey);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -134,7 +126,6 @@ namespace configmgr ...@@ -134,7 +126,6 @@ namespace configmgr
template < class Key, class Object, class KeyCompare > template < class Key, class Object, class KeyCompare >
rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::insert(Key const & _aKey, Ref const & _anEntry) rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::insert(Key const & _aKey, Ref const & _anEntry)
{ {
osl::MutexGuard aGuard(m_aMutex);
Ref aRef = internalAdd(_aKey,_anEntry); Ref aRef = internalAdd(_aKey,_anEntry);
return aRef; return aRef;
...@@ -144,7 +135,6 @@ namespace configmgr ...@@ -144,7 +135,6 @@ namespace configmgr
template < class Key, class Object, class KeyCompare > template < class Key, class Object, class KeyCompare >
rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::remove(Key const & _aKey) rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::remove(Key const & _aKey)
{ {
osl::MutexGuard aGuard(m_aMutex);
Ref aRef = internalGet(_aKey); Ref aRef = internalGet(_aKey);
internalDrop(_aKey); internalDrop(_aKey);
return aRef; return aRef;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: confsvccomponent.hxx,v $ * $RCSfile: confsvccomponent.hxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 03:46:36 $ * last change: $Author: ihi $ $Date: 2007-11-23 14:17:45 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -75,7 +75,6 @@ namespace configmgr ...@@ -75,7 +75,6 @@ namespace configmgr
: public ServiceImplBase : public ServiceImplBase
{ {
protected: protected:
::osl::Mutex m_aMutex;
ServiceImplementationInfo const*const m_info; ServiceImplementationInfo const*const m_info;
public: public:
ServiceComponentImpl(ServiceImplementationInfo const* aInfo); ServiceComponentImpl(ServiceImplementationInfo const* aInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment