diff options
author | Ole Loots <ole@monochrom.net> | 2013-04-16 08:31:38 +0200 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2013-04-16 08:31:38 +0200 |
commit | 1e2bd8296a3e3ce7e7bdd249f5cb6d5fcf601236 (patch) | |
tree | e634c4f2b3bb934974c03835e103204ea429dcf1 | |
parent | 000dddb260653590873b69d525daa42443659c63 (diff) | |
parent | 4da186e28eaa642d0b399e036af4540784f5076d (diff) | |
download | netsurf-1e2bd8296a3e3ce7e7bdd249f5cb6d5fcf601236.tar.gz netsurf-1e2bd8296a3e3ce7e7bdd249f5cb6d5fcf601236.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
-rw-r--r-- | amiga/Makefile.target | 2 | ||||
-rw-r--r-- | amiga/download.c | 13 | ||||
-rw-r--r-- | amiga/gui.c | 30 | ||||
-rw-r--r-- | amiga/options.h | 3 |
4 files changed, 12 insertions, 36 deletions
diff --git a/amiga/Makefile.target b/amiga/Makefile.target index dc79479c5..29543c715 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -2,7 +2,7 @@ # Amiga target setup # ---------------------------------------------------------------------------- -CFLAGS += -std=c99 -Dnsamiga +CFLAGS += -std=c99 -Dnsamiga -DFETCHER_CURLL_SCHEDULED ifneq ($(SUBTARGET),os3) CFLAGS += -U__STRICT_ANSI__ -D__USE_INLINE__ -D__USE_BASETYPE__ 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 998b169b0..e2616cf21 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2459,27 +2459,19 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig , } } +static void ami_gui_fetch_callback(void *p) +{ + /* This doesn't need to do anything - the scheduled event will + * send a message to trigger Wait() to return, thereby causing + * the event function to return, and NetSurf to call + * hlcache_poll() as part of the usual fetch/event loop. + */ +} + 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(active) - { - ami_handle_msg(); - ami_handle_appmsg(); - ami_handle_applib(); - ami_arexx_handle(); - schedule_run(TRUE); - } - else - { - ami_get_msg(); - } + if(active) schedule(0, ami_gui_fetch_callback, NULL); + 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}, \ |