From 4b9fcb1ad0c250d4afe648ddf0219da692b013d9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 15 Apr 2013 22:53:26 +0100 Subject: [PATCH 1/2] NetSurf appears to need to call hlcache_poll even if no fetches are active otherwise it sometimes gets stuck when fetching --- desktop/netsurf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop/netsurf.c b/desktop/netsurf.c index dd4000bc0..120bda9e3 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -254,6 +254,7 @@ int netsurf_main_loop(void) if(fetch_active) schedule(0, netsurf_fetch_callback, NULL); gui_poll(fetch_active); + hlcache_poll(); } return 0; From 3b53d22260fd44ba69acacc61b2e1737ab6cc733 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 15 Apr 2013 23:02:32 +0100 Subject: [PATCH 2/2] Remove no-longer-needed code --- amiga/download.c | 13 ------------- amiga/gui.c | 20 +------------------- amiga/options.h | 3 --- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/amiga/download.c b/amiga/download.c index 16a50d8ff..b9b27ab9f 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -85,7 +85,6 @@ enum { }; int downloads_in_progress = 0; -BYTE original_task_priority = 0; struct gui_download_window *gui_download_window_create(download_context *ctx, struct gui_window *gui) @@ -186,13 +185,6 @@ struct gui_download_window *gui_download_window_create(download_context *ctx, dw->node = AddObject(window_list,AMINS_DLWINDOW); dw->node->objstruct = dw; - /* Set task priority to -1. - * NetSurf loops without Wait()ing when downloading, - * so this gives other tasks a bit more CPU time. */ - if(downloads_in_progress == 0) { - original_task_priority = SetTaskPri(FindTask(0), (BYTE)nsoption_int(download_task_pri)); - LOG(("Now running at priority %d (was %d)", nsoption_int(download_task_pri), original_task_priority)); - } downloads_in_progress++; return dw; @@ -282,12 +274,7 @@ void gui_download_window_done(struct gui_download_window *dw) SetComment(dw->fname, dw->url); if(dw->url) free(dw->url); - /* Set task priority back to what it was originally */ downloads_in_progress--; - if(downloads_in_progress == 0) { - BYTE taskpri = SetTaskPri(FindTask(0), original_task_priority); - LOG(("Now running at priority %d (was %d)", original_task_priority, taskpri)); - } DisposeObject(dw->objects[OID_MAIN]); DelObject(dw->node); diff --git a/amiga/gui.c b/amiga/gui.c index d77bdfa48..b6de46df9 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2461,25 +2461,7 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig , void gui_poll(bool active) { - /* However, down here we are waiting for the user to do something or for a - scheduled event to kick in (the active variable seems to have no real - bearing on reality, but is supposed to indicate that NetSurf wants - control back ASAP, so we poll in that case). - schedule_run checks every event, really they need to be sorted so only - the first event needs to be run on each signal. */ - - if(0) - { - ami_handle_msg(); - ami_handle_appmsg(); - ami_handle_applib(); - ami_arexx_handle(); - schedule_run(TRUE); - } - else - { - ami_get_msg(); - } + ami_get_msg(); } void ami_change_tab(struct gui_window_2 *gwin, int direction) diff --git a/amiga/options.h b/amiga/options.h index de65c3ee0..822a7a3aa 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -48,7 +48,6 @@ char *arexx_shutdown; \ char *download_dir; \ bool download_notify; \ - int download_task_pri; \ bool faster_scroll; \ bool scale_quality; \ int dither_quality; \ @@ -115,7 +114,6 @@ .arexx_shutdown = NULL, \ .download_dir = NULL, \ .download_notify = false, \ - .download_task_pri = -1, \ .faster_scroll = true, \ .scale_quality = false, \ .dither_quality = 1, \ @@ -181,7 +179,6 @@ { "arexx_shutdown", OPTION_STRING, &nsoptions.arexx_shutdown }, \ { "download_dir", OPTION_STRING, &nsoptions.download_dir }, \ { "download_notify", OPTION_BOOL, &nsoptions.download_notify}, \ -{ "download_task_pri", OPTION_INTEGER, &nsoptions.download_task_pri}, \ { "faster_scroll", OPTION_BOOL, &nsoptions.faster_scroll}, \ { "scale_quality", OPTION_BOOL, &nsoptions.scale_quality}, \ { "dither_quality", OPTION_INTEGER, &nsoptions.dither_quality}, \