diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-13 13:12:00 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-18 11:41:52 +0200 |
commit | 0c27134fb993b30e1a0ce827364c35f8fbaac359 (patch) | |
tree | 24c7e472d5379c05e71f023278d50625d67823e9 /vcl/inc/salinst.hxx | |
parent | fb1ef04ef8edac85f2d391c508e286621057fef6 (diff) |
Move yield mutex handling into SalInstance
After the refectoring in commit 4c93de2c921b ("merge
GenericSolarMutex and SolarMutex"), there is no more need to
prevent instantiation of comphelper::SolarMutex objects.
Since every VCL backend implements the yield mutex management in
the same way, we can move the general implementation into the
SalInstance.
While at it use std::unique_ptr for the yield mutex on Mac and
Windows platforms.
Change-Id: Ibe0610bd92b4623152ee14e7a35b52465d403720
Reviewed-on: https://gerrit.libreoffice.org/60570
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc/salinst.hxx')
-rw-r--r-- | vcl/inc/salinst.hxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 912ce9ac98f0..3ee6aca23567 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -81,9 +81,10 @@ class VCL_PLUGIN_PUBLIC SalInstance { private: rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst; + const std::unique_ptr<comphelper::SolarMutex> m_pYieldMutex; public: - SalInstance() {} + SalInstance(std::unique_ptr<comphelper::SolarMutex> pMutex); virtual ~SalInstance(); //called directly after Application::Init @@ -135,11 +136,11 @@ public: virtual std::shared_ptr<SalBitmap> CreateSalBitmap() = 0; // YieldMutex - virtual comphelper::SolarMutex* - GetYieldMutex() = 0; - virtual sal_uInt32 ReleaseYieldMutexAll() = 0; - virtual void AcquireYieldMutex( sal_uInt32 nCount = 1 ) = 0; - // return true, if yield mutex is owned by this thread, else false + comphelper::SolarMutex* GetYieldMutex(); + sal_uInt32 ReleaseYieldMutexAll(); + void AcquireYieldMutex(sal_uInt32 nCount = 1); + + // return true, if the current thread is the main thread virtual bool IsMainThread() const = 0; /** |