diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-04 15:28:37 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-04 14:46:01 +0100 |
commit | e128f7806961b391cfb265a1ce009b2e036622ca (patch) | |
tree | eda1097987f07ac6e2f507f898b71ddf929e0635 /stoc/test | |
parent | a2058e7516a01167c2d20ed157500b38db967c64 (diff) |
replace double-checked locking patterns with thread safe local statics
Change-Id: I1bf67196e97411aeecc13ed4f91d1088a315e323
Reviewed-on: https://gerrit.libreoffice.org/62839
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'stoc/test')
-rw-r--r-- | stoc/test/testsmgr_cpnt.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx index 638ad81c1cce..ddb6e4ca1b29 100644 --- a/stoc/test/testsmgr_cpnt.cxx +++ b/stoc/test/testsmgr_cpnt.cxx @@ -64,13 +64,8 @@ using namespace cppu; Reference<XMultiServiceFactory> getProcessServiceManager() { - Reference<XMultiServiceFactory > s_x; - if (! s_x.is()) - { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! s_x.is()) - s_x = createRegistryServiceFactory( OUString("stoctest.rdb"), sal_False ); - } + static Reference<XMultiServiceFactory> s_x( + createRegistryServiceFactory(OUString("stoctest.rdb"), sal_False)); return s_x; } |