From 00f257a7ef4f1ec52887bc379c14757e057e94c8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Aug 2021 16:13:42 +0200 Subject: rtl::Static -> thread-safe static local Change-Id: Iac0501e6aa35cc3d8e62f6b6e68b76cf70233aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120459 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/app/app.cxx | 5 ++--- desktop/source/app/officeipcthread.cxx | 9 ++------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index ade68fd5efc0..f65f93d63f80 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -383,13 +383,12 @@ void FatalError(const OUString& sMessage) _exit(EXITHELPER_FATAL_ERROR); } -struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {}; - } CommandLineArgs& Desktop::GetCommandLineArgs() { - return theCommandLineArgs::get(); + static CommandLineArgs theCommandLineArgs; + return theCommandLineArgs; } OUString ReplaceStringHookProc( const OUString& rStr ) diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index a0e6b98cc006..61827856f3e9 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -635,15 +635,10 @@ void DbusIpcThread::close() { #endif -namespace -{ - class theRequestHandlerMutex - : public rtl::Static {}; -} - ::osl::Mutex& RequestHandler::GetMutex() { - return theRequestHandlerMutex::get(); + static ::osl::Mutex theRequestHandlerMutex; + return theRequestHandlerMutex; } void RequestHandler::SetDowning() -- cgit v1.2.3