diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-03-17 12:07:31 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-03-17 12:07:31 +0000 |
commit | df8de388dc57feba081a00eae9d66f41211abbae (patch) | |
tree | 5346f39a2f47af23283f69a2d16d67db6e6d010a /extensions/source/ole/ole2uno.cxx | |
parent | INTEGRATION: CWS jl5vba (1.11.48); FILE MERGED (diff) | |
download | core-df8de388dc57feba081a00eae9d66f41211abbae.tar.gz core-df8de388dc57feba081a00eae9d66f41211abbae.zip |
INTEGRATION: CWS jl5vba (1.1.222); FILE MERGED
2004/01/19 10:54:46 jl 1.1.222.1: #99049# #109536# join cws ab02vba
Diffstat (limited to 'extensions/source/ole/ole2uno.cxx')
-rw-r--r-- | extensions/source/ole/ole2uno.cxx | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/extensions/source/ole/ole2uno.cxx b/extensions/source/ole/ole2uno.cxx index 7f7ebda9b196..50a063bfd642 100644 --- a/extensions/source/ole/ole2uno.cxx +++ b/extensions/source/ole/ole2uno.cxx @@ -1,25 +1,43 @@ - -#include <osl/mutex.hxx> +#include "osl/getglobalmutex.hxx" +#include "rtl/instance.hxx" #include "ole2uno.hxx" using namespace osl; namespace ole_adapter { -Mutex* getBridgeMutex() +struct MutexInit { - static Mutex* pMutex= NULL; - - if( ! pMutex) + Mutex * operator () () { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pMutex) - { - static Mutex aMutex; - pMutex= &aMutex; - } + static Mutex aInstance; + return &aInstance; } - return pMutex; +}; + + +Mutex * getBridgeMutex() +{ + return rtl_Instance< Mutex, MutexInit, ::osl::MutexGuard, + ::osl::GetGlobalMutex >::create( + MutexInit(), ::osl::GetGlobalMutex()); } + +// Mutex* getBridgeMutex() +// { +// static Mutex* pMutex= NULL; + +// if( ! pMutex) +// { +// MutexGuard guard( Mutex::getGlobalMutex() ); +// if( !pMutex) +// { +// static Mutex aMutex; +// pMutex= &aMutex; +// } +// } +// return pMutex; +// } + } |