summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-04-15 19:49:36 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2013-04-15 19:49:36 +0100
commitc6c4747a28816b3d8b9b4271b7cdb2ec84bc3715 (patch)
tree1c3694642b91d010de3df5f53d7b6103cd6e1702
parent0d976df9f34cb290c96e7b8b2e5d2bdc12000213 (diff)
downloadnetsurf-c6c4747a28816b3d8b9b4271b7cdb2ec84bc3715.tar.gz
netsurf-c6c4747a28816b3d8b9b4271b7cdb2ec84bc3715.tar.bz2
Schedule fetches so the frontend can wait for a scheduled event, rather than busy-looping.
-rw-r--r--desktop/netsurf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 0b1cffe0a..5945b31a1 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -239,6 +239,10 @@ nserror netsurf_init(int *pargc,
return ret;
}
+static void netsurf_fetch_callback(void *p)
+{
+ hlcache_poll();
+}
/**
* Gui NetSurf main loop.
@@ -246,8 +250,9 @@ nserror netsurf_init(int *pargc,
int netsurf_main_loop(void)
{
while (!netsurf_quit) {
+ if(fetch_active)
+ schedule(0, netsurf_fetch_callback, NULL);
gui_poll(fetch_active);
- hlcache_poll();
}
return 0;