diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-13 16:13:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-15 19:17:01 +0200 |
commit | 00f257a7ef4f1ec52887bc379c14757e057e94c8 (patch) | |
tree | 816bf25723911674850987df481919816c627416 /cppu | |
parent | 6c12c659fb22aeab1d1d5d0e8298662e2a602499 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppu')
-rw-r--r-- | cppu/source/threadpool/threadpool.cxx | 16 | ||||
-rw-r--r-- | cppu/source/uno/lbenv.cxx | 5 |
2 files changed, 4 insertions, 17 deletions
diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index 86c280b4b352..512ddb095cd2 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.cxx @@ -25,7 +25,6 @@ #include <unordered_map> #include <osl/diagnose.h> -#include <rtl/instance.hxx> #include <sal/log.hxx> #include <uno/threadpool.h> @@ -43,21 +42,10 @@ namespace cppu_threadpool rtl::Reference<ORequestThread> const & theThread): thread(theThread) {} - namespace { - - struct theDisposedCallerAdmin : - public rtl::StaticWithInit< DisposedCallerAdminHolder, theDisposedCallerAdmin > - { - DisposedCallerAdminHolder operator () () { - return std::make_shared<DisposedCallerAdmin>(); - } - }; - - } - DisposedCallerAdminHolder const & DisposedCallerAdmin::getInstance() { - return theDisposedCallerAdmin::get(); + static DisposedCallerAdminHolder theDisposedCallerAdmin = std::make_shared<DisposedCallerAdmin>(); + return theDisposedCallerAdmin; } DisposedCallerAdmin::~DisposedCallerAdmin() diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 03dbc99eafcc..ad61cee0cf67 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -819,11 +819,10 @@ namespace const OUString& getOIdPart() const { return m_sOidPart; } }; - class theStaticOIdPart : public rtl::Static<makeOIdPart, theStaticOIdPart> {}; - const OUString & unoenv_getStaticOIdPart() { - return theStaticOIdPart::get().getOIdPart(); + static makeOIdPart theStaticOIdPart; + return theStaticOIdPart.getOIdPart(); } } |