summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2021-06-05 13:38:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-14 19:12:01 +0200
commitc82914912f73f1fc9912d53fb60ca7a66379c560 (patch)
treea8116dd15420d5616ce69368c779057216dfd56e /cppuhelper
parent12b57e43563a643dd653d78f3e2877ef75998d82 (diff)
cppuhelper : use std::mutex and remove useless rtl::Static
Change-Id: Idb272e664c4b745c4db96e505b60905c93937900 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/implbase_ex.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx
index 00eeaf376618..24b7a74582d7 100644
--- a/cppuhelper/source/implbase_ex.cxx
+++ b/cppuhelper/source/implbase_ex.cxx
@@ -24,28 +24,16 @@
#include <com/sun/star/uno/RuntimeException.hpp>
+#include <mutex>
+
using namespace ::cppu;
using namespace ::osl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-namespace
-{
- class theImplHelperInitMutex : public rtl::Static<Mutex, theImplHelperInitMutex>{};
-}
-
namespace cppu
{
-/** Shared mutex for implementation helper initialization.
- Not for public use.
-*/
-static ::osl::Mutex & getImplHelperInitMutex()
-{
- return theImplHelperInitMutex::get();
-}
-
-
static void checkInterface( Type const & rType )
{
if (TypeClass_INTERFACE != rType.getTypeClass())
@@ -79,7 +67,8 @@ static type_entry * getTypeEntries( class_data * cd )
type_entry * pEntries = cd->m_typeEntries;
if (! cd->m_storedTypeRefs) // not inited?
{
- MutexGuard guard( getImplHelperInitMutex() );
+ static std::mutex aMutex;
+ std::lock_guard guard( aMutex );
if (! cd->m_storedTypeRefs) // not inited?
{
// get all types