diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-07 11:50:26 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-12 23:18:49 +0100 |
commit | dcdaca599987ded1577bd04ed1e70f5bd02e943f (patch) | |
tree | aed81999c67050bbff5d4e521d5ea2f9766dc5f8 /include | |
parent | 38a3886fc1464e635985f9ec82b48e0a69f6e536 (diff) |
use a mutex per instance for SvNumberFormatter
instead of one mutex for all instances. We still keep the global mutex
for some operations because there are some shared global data
structures.
Change-Id: Ic1106baa23d4ade18dbd732ad74979f3996f326b
Reviewed-on: https://gerrit.libreoffice.org/46304
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svl/zforlist.hxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 87821414325e..5ac719d5fe4d 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -320,6 +320,7 @@ class NfCurrencyTable; class SVL_DLLPUBLIC SvNumberFormatter { + friend class SvNumberFormatterRegistry_Impl; public: /** * We can't technically have an "infinite" value, so we use an arbitrary @@ -803,6 +804,7 @@ public: static bool IsLocaleInstalled( LanguageType eLang ); private: + mutable ::osl::Mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext > m_xContext; LanguageTag maLanguageTag; std::map<sal_uInt32, std::unique_ptr<SvNumberformat>> aFTable; // Table of format keys to format entries @@ -831,7 +833,7 @@ private: OUString aThousandSep; OUString aDateSep; - SVL_DLLPRIVATE static bool bCurrencyTableInitialized; + SVL_DLLPRIVATE static volatile bool bCurrencyTableInitialized; SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition; SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry; @@ -914,10 +916,11 @@ private: // Substitute a format during GetFormatEntry(), i.e. system formats. SvNumberformat* ImpSubstituteEntry( SvNumberformat* pFormat, sal_uInt32 * o_pRealKey = nullptr ); -public: + // own mutex, may also be used by internal class SvNumberFormatterRegistry_Impl + static ::osl::Mutex& GetGlobalMutex(); + ::osl::Mutex& GetInstanceMutex() const { return m_aMutex; } - // own static mutex, may also be used by internal class SvNumberFormatterRegistry_Impl - static ::osl::Mutex& GetMutex(); +public: // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes void ResetDefaultSystemCurrency(); |