Piotr Caban : mshtml: Limit number of tasks processed in process_timer.
Alexandre Julliard
julliard at winehq.org
Fri Apr 26 11:21:21 CDT 2013
Module: wine
Branch: master
Commit: a6fbf560e9d05256a0b2ba5b5c17cc65fb51e00a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a6fbf560e9d05256a0b2ba5b5c17cc65fb51e00a
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Apr 26 15:47:36 2013 +0200
mshtml: Limit number of tasks processed in process_timer.
---
dlls/mshtml/task.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c
index bb8b4e0..f9f12d5 100644
--- a/dlls/mshtml/task.c
+++ b/dlls/mshtml/task.c
@@ -255,17 +255,29 @@ static LRESULT process_timer(void)
thread_data_t *thread_data;
IDispatch *disp;
DWORD tc;
- task_timer_t *timer;
+ task_timer_t *timer=NULL, *last_timer;
TRACE("\n");
thread_data = get_thread_data(FALSE);
assert(thread_data != NULL);
- while(!list_empty(&thread_data->timer_list)) {
- timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
+ if(list_empty(&thread_data->timer_list)) {
+ KillTimer(thread_data->thread_hwnd, TIMER_ID);
+ return 0;
+ }
+ last_timer = LIST_ENTRY(list_tail(&thread_data->timer_list), task_timer_t, entry);
+ do {
tc = GetTickCount();
+ if(timer == last_timer) {
+ timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
+ SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time>tc ? timer->time-tc : 0, NULL);
+ return 0;
+ }
+
+ timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
+
if(timer->time > tc) {
SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time-tc, NULL);
return 0;
@@ -284,7 +296,7 @@ static LRESULT process_timer(void)
call_timer_disp(disp);
IDispatch_Release(disp);
- }
+ }while(!list_empty(&thread_data->timer_list));
KillTimer(thread_data->thread_hwnd, TIMER_ID);
return 0;
More information about the wine-cvs
mailing list