summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-03-25 13:47:43 +0000
committerKurt Zenker <kz@openoffice.org>2004-03-25 13:47:43 +0000
commit49c6d824994d7e5b81826cde414075d00dc75565 (patch)
tree49a1553e8dfae2d29e0df66b73e8d882ae69776e
parent563c60431518f8230e3f3e672a99f68748d474e8 (diff)
INTEGRATION: CWS jl3 (1.1.82); FILE MERGED
2003/12/19 11:32:28 dbo 1.1.82.1: #114506# cleanup
-rw-r--r--stoc/source/registry_tdprovider/td.cxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/stoc/source/registry_tdprovider/td.cxx b/stoc/source/registry_tdprovider/td.cxx
index c86848b13a8d..e1651fa98f37 100644
--- a/stoc/source/registry_tdprovider/td.cxx
+++ b/stoc/source/registry_tdprovider/td.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: td.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: kso $ $Date: 2002-11-11 08:35:46 $
+ * last change: $Author: kz $ $Date: 2004-03-25 14:47:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,12 +59,36 @@
*
************************************************************************/
+#include "osl/doublecheckedlocking.h"
#ifndef _STOC_RDBTDP_BASE_HXX
#include "base.hxx"
#endif
namespace stoc_rdbtdp
{
+
+//------------------------------------------------------------------------------
+::osl::Mutex & getMutex()
+{
+ static ::osl::Mutex * s_pmutex = 0;
+ if (s_pmutex == 0)
+ {
+ ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
+ if (s_pmutex == 0)
+ {
+ static ::osl::Mutex s_mutex;
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ s_pmutex = &s_mutex;
+ }
+ }
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ }
+ return *s_pmutex;
+}
+
+
TypeDescriptionImpl::~TypeDescriptionImpl()
{
g_moduleCount.modCnt.release( &g_moduleCount.modCnt );