diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-04-11 23:49:12 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-06-18 20:54:15 +0200 |
commit | d627865169f2261d9f596078bfaaca09e99174e4 (patch) | |
tree | 6793bfd47c686557939398329b67e98a268c4369 /vcl/inc | |
parent | 360b7b66d7a5b318baf6f4a23b8b66ae778003d4 (diff) |
tdf#96887 vcl: stop using periodic timers on WNT
Every time the periodic timer fires, it does a PostMessage() to the
main thread. The main thread will only process the first message and
discard the rest anyway, but with a short enough timer and other
threads hogging the SolarMutex it's possible that the message queue
overflows and other PostMessage calls fail with ERROR_NOT_ENOUGH_QUOTA.
Try to avoid the problem by having the WinSalTimer always be a one-shot
timer; when it fires and the main thread processes the posted message,
it is restarted with the new due time.
This requires creating a new TimerQueueTimer because
ChangeTimerQueueTimer only works on periodic timers.
Change-Id: I816bd3fa5fbfbea4f26be8ff680a1c916618d3f9
Reviewed-on: https://gerrit.libreoffice.org/24024
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/26257
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 25ba37abcc8ad381be6038ddb332dd60d3dcf4b1)
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 66b8a7fd7179..83e853f6b051 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -277,6 +277,8 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); // Call the Timer's callback from the main thread #define SAL_MSG_TIMER_CALLBACK (WM_USER+162) +// Stop the timer from the main thread; wParam = 0, lParam = 0 +#define SAL_MSG_STOPTIMER (WM_USER+163) inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis ) { diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index fe2c3414593e..43c0313efa7d 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -83,6 +83,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, SalFrameSt SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent ); HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, bool bAsChild ); void ImplSalStartTimer( sal_uIntPtr nMS, bool bMutex = false ); +void ImplSalStopTimer(); #endif // INCLUDED_VCL_INC_WIN_SALINST_H |