summaryrefslogtreecommitdiff
path: root/framework/source/helper/ocomponentenumeration.cxx
diff options
context:
space:
mode:
authorAndreas Schlüns <as@openoffice.org>2001-06-11 09:29:50 +0000
committerAndreas Schlüns <as@openoffice.org>2001-06-11 09:29:50 +0000
commit2923606bdf98ab543b67c2166f6e84d22722cb26 (patch)
tree4ddf27356d2c3117a55ec0ef5609d200563adad2 /framework/source/helper/ocomponentenumeration.cxx
parent626f8b25859d4ed263bbb3d4caab3ca2ccba5ed7 (diff)
#85529# use new lock mechanism
Diffstat (limited to 'framework/source/helper/ocomponentenumeration.cxx')
-rw-r--r--framework/source/helper/ocomponentenumeration.cxx28
1 files changed, 18 insertions, 10 deletions
diff --git a/framework/source/helper/ocomponentenumeration.cxx b/framework/source/helper/ocomponentenumeration.cxx
index 9102c488543e..dfc43dae87c1 100644
--- a/framework/source/helper/ocomponentenumeration.cxx
+++ b/framework/source/helper/ocomponentenumeration.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ocomponentenumeration.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $
+ * last change: $Author: as $ $Date: 2001-06-11 10:28:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,6 +67,10 @@
#include <helper/ocomponentenumeration.hxx>
#endif
+#ifndef _FRAMEWORK_THREADHELP_RESETABLEGUARD_HXX_
+#include <threadhelp/resetableguard.hxx>
+#endif
+
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
@@ -75,6 +79,10 @@
// includes of other projects
//_________________________________________________________________________________________________________________
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
@@ -108,14 +116,14 @@ OComponentEnumeration::OComponentEnumeration( const Sequence< Reference< XCompon
// Init baseclasses first
// Attention:
// Don't change order of initialization!
- // OMutexMember is a struct with a mutex as member. We can't use a mutex as member, while
+ // ThreadHelpBase is a struct with a mutex as member. We can't use a mutex as member, while
// we must garant right initialization and a valid value of this! First initialize
// baseclasses and then members. And we need the mutex for other baseclasses !!!
- : OMutexMember ( )
- , OWeakObject ( )
+ : ThreadHelpBase ( &Application::GetSolarMutex() )
+ , OWeakObject ( )
// Init member
- , m_nPosition ( 0 ) // 0 is the first position for a valid list and the right value for an invalid list to!
- , m_seqComponents ( seqComponents )
+ , m_nPosition ( 0 ) // 0 is the first position for a valid list and the right value for an invalid list to!
+ , m_seqComponents ( seqComponents )
{
// Safe impossible states
// "Method" not defined for ALL parameters!
@@ -153,7 +161,7 @@ DEFINE_XTYPEPROVIDER_3 ( OComponentEnumeration ,
void SAL_CALL OComponentEnumeration::disposing( const EventObject& aEvent ) throw( RuntimeException )
{
// Ready for multithreading
- LOCK_MUTEX( aGuard, m_aMutex, "OComponentEnumeration::disposing()" )
+ ResetableGuard aGuard( m_aLock );
// Safe impossible cases
// This method is not specified for all incoming parameters.
@@ -169,7 +177,7 @@ void SAL_CALL OComponentEnumeration::disposing( const EventObject& aEvent ) thro
sal_Bool SAL_CALL OComponentEnumeration::hasMoreElements() throw( RuntimeException )
{
// Ready for multithreading
- LOCK_MUTEX( aGuard, m_aMutex, "OComponentEnumeration::hasMoreElements()" )
+ ResetableGuard aGuard( m_aLock );
// First position in a valid list is 0.
// => The last one is getLength() - 1!
@@ -186,7 +194,7 @@ Any SAL_CALL OComponentEnumeration::nextElement() throw( NoSuchElementExcepti
RuntimeException )
{
// Ready for multithreading
- LOCK_MUTEX( aGuard, m_aMutex, "OComponentEnumeration::nextElement()" )
+ ResetableGuard aGuard( m_aLock );
// If we have no elements or end of enumeration is arrived ...
if ( hasMoreElements() == sal_False )