summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorLars Langhans <lla@openoffice.org>2000-12-06 08:36:29 +0000
committerLars Langhans <lla@openoffice.org>2000-12-06 08:36:29 +0000
commitb2e87219b43e14ac4e190e3ee688d9972952f38d (patch)
tree804cd540d553813fdd8efefe36022da8ab8ba7f3 /cppuhelper
parent8981a051c303155d3df0ddf17d9c53e4a94e707e (diff)
#81393# createInstanceEveryTime was not thread save
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/factory.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index ae406398d5cd..449bae49b4c3 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: factory.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jsc $ $Date: 2000-10-18 13:20:58 $
+ * last change: $Author: lla $ $Date: 2000-12-06 09:36:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -437,9 +437,11 @@ Reference<XInterface > ORegistryFactoryHelper::createInstanceEveryTime()
if( !xModuleFactory.is() )
{
MutexGuard aGuard( aMutex );
- xModuleFactory = createModuleFactory();
+ if( !xModuleFactory.is() ) // is xModuleFactory really not set (MultiThreaded!)
+ {
+ xModuleFactory = createModuleFactory();
+ }
}
-
if( xModuleFactory.is() )
return xModuleFactory->createInstance();
@@ -535,7 +537,10 @@ Reference<XInterface > SAL_CALL ORegistryFactoryHelper::createInstanceWithArgume
if( !xModuleFactory.is() )
{
MutexGuard aGuard( aMutex );
- xModuleFactory = createModuleFactory();
+ if( !xModuleFactory.is() ) // MultiThreaded!
+ {
+ xModuleFactory = createModuleFactory();
+ }
}
if( xModuleFactory.is() )