diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-08-28 19:58:32 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-09-26 09:42:11 +0200 |
commit | 4baec725e0dc0713f0d47003e9b10bc3b62f56ff (patch) | |
tree | 72f21c28416068e46133964e420ca094af8b7587 /vcl/inc | |
parent | f633dcdfc0ad7a13d096d97b6753b55e8f8a3f07 (diff) |
WIN run main thread redirects ignoring SolarMutex
This way we can drop all the special nReleased handling. Instead
we use the same mechanism as on Mac, where we keep the lock, but
disable it for the main thread. As a security measure we assert on
duplicate redirects, which should not happen.
As a result we can't use SendMessage on the main thread itself,
which would normally just call the WinProc directly. This could be
accomplished by converting the redirect bool into a counter, which
should be safe, as no other thread could acquire the SolarMutex,
as we don't release it.
Change-Id: Icd87b3da37a2489f3cad2bc80215bf93fc41d388
Reviewed-on: https://gerrit.libreoffice.org/42583
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/osx/salinst.h | 3 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 2 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 5 |
6 files changed, 9 insertions, 7 deletions
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx index e8bb96ab68ac..0883981c4406 100644 --- a/vcl/inc/headless/svpinst.hxx +++ b/vcl/inc/headless/svpinst.hxx @@ -155,7 +155,7 @@ public: // wait next event and dispatch // must returned by UserEvent (SalFrame::PostEvent) // and timer - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override; virtual bool AnyInput( VclInputFlags nType ) override; virtual bool IsMainThread() const override { return true; } diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index 1f456f737901..65db0d0b0f2a 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -114,8 +114,7 @@ public: virtual comphelper::SolarMutex* GetYieldMutex() override; virtual sal_uInt32 ReleaseYieldMutex( bool bUnlockAll = false ) override; virtual void AcquireYieldMutex( sal_uInt32 nCount = 1 ) override; - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, - sal_uLong nReleased) override; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override; virtual bool AnyInput( VclInputFlags nType ) override; virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) override; virtual void DestroyMenu( SalMenu* ) override; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 12959cc44280..8418a1ed8126 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -133,7 +133,7 @@ public: * If bHandleAllCurrentEvents - dispatch multiple posted * user events. Returns true if events were processed. */ - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) = 0; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) = 0; virtual bool AnyInput( VclInputFlags nType ) = 0; // menus diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 1585c778afac..595a7adb7089 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -208,7 +208,7 @@ public: const SystemGraphicsData* = nullptr ) override; virtual SalBitmap* CreateSalBitmap() override; - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override; virtual bool AnyInput( VclInputFlags nType ) override; // impossible to handle correctly, as "main thread" depends on the dispatch mutex virtual bool IsMainThread() const override { return false; } diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index 2307410fe69e..59464b4c60e5 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -74,7 +74,7 @@ public: virtual SalSession* CreateSalSession() override; virtual OpenGLContext* CreateOpenGLContext() override; - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override; virtual bool AnyInput( VclInputFlags nType ) override; virtual bool IsMainThread() const override { return true; } diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 6efecbd6bd5e..8772ee00fa22 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -34,6 +34,9 @@ public: /// The Yield mutex ensures that only one thread calls into VCL SalYieldMutex* mpSalYieldMutex; + osl::Condition maWaitingYieldCond; + bool mbNoYieldLock; + public: WinSalInstance(); virtual ~WinSalInstance() override; @@ -63,7 +66,7 @@ public: virtual void AcquireYieldMutex( sal_uInt32 nCount = 1 ) override; virtual bool IsMainThread() const override; - virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; + virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override; virtual bool AnyInput( VclInputFlags nType ) override; virtual SalMenu* CreateMenu( bool bMenuBar, Menu* ) override; virtual void DestroyMenu( SalMenu* ) override; |