diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-04-08 15:14:43 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-06-18 20:54:14 +0200 |
commit | 360b7b66d7a5b318baf6f4a23b8b66ae778003d4 (patch) | |
tree | 9510f47706e1101fbb9c0df9ade921e7c40813a1 /vcl/inc | |
parent | 0e2d2c4e9cd56a95e56ba6d953a68d3b5cdc6c59 (diff) |
tdf#96887 enhance SolarMutex AcquireWithWait for Windows
Currently the Windows-specific method ImplSalYieldMutexAcquireWithWait()
uses a messaging mechanism to learn about the SolarMutex being free again.
This is not reliable when the MessageQueue overflows (MS allows 10000
messages per queue). It is more safe to use MsgWaitForMultipleObjects.
This also allows to not only wait for the SolarMutex to be freed, but
also to detect when SendMessage() is used which needs to lead to a
reschedule to not block current Window handling.
Change-Id: Id317dda62aaa1fe7677d8d28929e6936e5a22705
Reviewed-on: https://gerrit.libreoffice.org/23921
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/26256
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 69fa1e78febb4991e8e8b8b53ddf5b2d4f7e9f00)
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 8 |
2 files changed, 0 insertions, 10 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index ed8a2fd9a2ec..66b8a7fd7179 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -214,8 +214,6 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); // wParam == bWait; lParam == 0 #define SAL_MSG_THREADYIELD (WM_USER+111) -// wParam == 0; lParam == 0 -#define SAL_MSG_RELEASEWAITYIELD (WM_USER+112) // wParam == 0; lParam == nMS #define SAL_MSG_STARTTIMER (WM_USER+113) // wParam == nFrameStyle; lParam == pParent; lResult == pFrame diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index b6408ea4f322..fe2c3414593e 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -33,14 +33,6 @@ public: HWND mhComWnd; /// The Yield mutex ensures that only one thread calls into VCL SalYieldMutex* mpSalYieldMutex; - /// The Wait mutex ensures increment of mnYieldWaitCount and acquisition - /// or release of mpSalYieldMutex is atomic - osl::Mutex* mpSalWaitMutex; - /// count main thread's pending ImplSalYieldMutexAcquireWithWait() calls - /// (it's not clear to me if this will be > 1 in practice; it would be - /// possible if main thread's handling of SAL_MSG_* sent by other threads - /// via SendMessage() ends up calling ImplSalYieldMutexAcquireWithWait()) - sal_uInt16 mnYieldWaitCount; public: WinSalInstance(); |