diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-03-25 13:47:43 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-03-25 13:47:43 +0000 |
commit | 4370acca821d57074de9d14070b3274f229bb721 (patch) | |
tree | 14683977e0bb14b0dd37cb42edaa324f57158a58 /stoc | |
parent | 2d7c1c3441ac16eb52c5cc9d8fd2bb570828d674 (diff) |
INTEGRATION: CWS jl3 (1.1.82); FILE MERGED
2003/12/19 11:32:28 dbo 1.1.82.1: #114506# cleanup
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/registry_tdprovider/td.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/stoc/source/registry_tdprovider/td.cxx b/stoc/source/registry_tdprovider/td.cxx index 08833f33f..66943ee84 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 ); |