summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-31 23:43:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-02 14:53:48 +0100
commit15f14ec79477142cf2bcb1484511b7bea6f1485b (patch)
treef8286d0e17062b579289a43fe3aa01ddb421d6d2 /ucbhelper
parentae9219769106648ac35d594fc07c83103a62ecbe (diff)
reorganize trickier statics
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/client/contentbroker.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx
index d1eb179b5b78..3d217f8fe206 100644
--- a/ucbhelper/source/client/contentbroker.cxx
+++ b/ucbhelper/source/client/contentbroker.cxx
@@ -34,6 +34,7 @@
*************************************************************************/
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
@@ -56,9 +57,7 @@ using ::rtl::OUString;
namespace
{
- osl::Mutex globalContentBrokerMutex;
- osl::Mutex & getGlobalContentBrokerMutex() { return globalContentBrokerMutex; }
-
+ struct theContentBrokerMutex : public rtl::Static< osl::Mutex, theContentBrokerMutex > {};
} // namespace
namespace ucbhelper
@@ -184,7 +183,7 @@ sal_Bool ContentBroker::initialize(
if ( !m_pTheBroker )
{
- osl::Guard< osl::Mutex > aGuard( getGlobalContentBrokerMutex() );
+ osl::Guard< osl::Mutex > aGuard( theContentBrokerMutex::get() );
if ( !m_pTheBroker )
{
@@ -237,7 +236,7 @@ InitUCBHelper()
// static
void ContentBroker::deinitialize()
{
- osl::MutexGuard aGuard( getGlobalContentBrokerMutex() );
+ osl::MutexGuard aGuard( theContentBrokerMutex::get() );
delete m_pTheBroker;
m_pTheBroker = 0;