mshtml: Limit number of tasks processed in process_timer.

This commit is contained in:
Piotr Caban 2013-04-26 15:47:36 +02:00 committed by Alexandre Julliard
parent 58dc0346d6
commit a6fbf560e9
1 changed files with 16 additions and 4 deletions

View File

@ -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)) {
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);
tc = GetTickCount();
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;