From cbf07e1bc3e11d7cce4769782f2acf76e47f6947 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 11 Feb 2009 22:33:55 +0000 Subject: [PATCH] make schedule_run return if it has active jobs to schedule svn path=/trunk/netsurf/; revision=6447 --- amiga/schedule.c | 6 ++++-- debug/netsurfd.c | 2 +- desktop/browser.h | 2 +- framebuffer/fb_schedule.c | 6 +++--- gtk/gtk_schedule.c | 5 +++-- riscos/schedule.c | 4 +++- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/amiga/schedule.c b/amiga/schedule.c index 008bf4d01..8ec7b3da0 100755 --- a/amiga/schedule.c +++ b/amiga/schedule.c @@ -115,7 +115,7 @@ void schedule_remove(void (*callback)(void *p), void *p) * Process events up to current time. */ -void schedule_run(void) +bool schedule_run(void) { struct nsObject *node; struct nsObject *nnode; @@ -124,7 +124,7 @@ void schedule_run(void) void *p; struct timeval tv; - if(IsMinListEmpty(schedule_list)) return; + if(IsMinListEmpty(schedule_list)) return false; GetSysTime(&tv); @@ -148,6 +148,8 @@ void schedule_run(void) } } } while(node=nnode); + + return true; } void ami_remove_timer_event(struct nscallback *nscb) diff --git a/debug/netsurfd.c b/debug/netsurfd.c index ee6c816f4..29db10d4f 100644 --- a/debug/netsurfd.c +++ b/debug/netsurfd.c @@ -202,7 +202,7 @@ void tree_set_node_sprite_folder(struct node *node) {} #ifndef riscos void schedule(int t, void (*callback)(void *p), void *p) {} void schedule_remove(void (*callback)(void *p), void *p) {} -void schedule_run(void) {} +bool schedule_run(void) {} #endif bool selection_highlighted(struct selection *s, unsigned start, unsigned end, diff --git a/desktop/browser.h b/desktop/browser.h index 89b1ab67d..3db08c325 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -265,7 +265,7 @@ bool thumbnail_create(struct content *content, struct bitmap *bitmap, /* In platform specific schedule.c. */ void schedule(int t, void (*callback)(void *p), void *p); void schedule_remove(void (*callback)(void *p), void *p); -void schedule_run(void); +bool schedule_run(void); /* In platform specific theme_install.c. */ #ifdef WITH_THEME_INSTALL diff --git a/framebuffer/fb_schedule.c b/framebuffer/fb_schedule.c index 6b73c375e..b96a00500 100644 --- a/framebuffer/fb_schedule.c +++ b/framebuffer/fb_schedule.c @@ -126,7 +126,7 @@ void schedule_remove(void (*callback)(void *p), void *p) * Process events up to current time. */ -void schedule_run(void) +bool schedule_run(void) { struct timeval tv; struct nscallback *cur_nscb; @@ -134,7 +134,7 @@ void schedule_run(void) struct nscallback *unlnk_nscb; if (schedule_list == NULL) - return; + return false; cur_nscb = schedule_list; prev_nscb = NULL; @@ -167,7 +167,7 @@ void schedule_run(void) cur_nscb = prev_nscb->next; } } - + return true; } void list_schedule(void) diff --git a/gtk/gtk_schedule.c b/gtk/gtk_schedule.c index 4fffd1691..3ef98a40d 100644 --- a/gtk/gtk_schedule.c +++ b/gtk/gtk_schedule.c @@ -107,14 +107,14 @@ schedule(int t, void (*callback)(void *p), void *p) g_timeout_add(msec_timeout, nsgtk_schedule_generic_callback, cb); } -void +bool schedule_run(void) { /* Capture this run of pending callbacks into the list. */ this_run = pending_callbacks; if (this_run == NULL) - return; /* Nothing to do */ + return false; /* Nothing to do */ /* Clear the pending list. */ pending_callbacks = NULL; @@ -129,4 +129,5 @@ schedule_run(void) cb->callback(cb->context); free(cb); } + return true; } diff --git a/riscos/schedule.c b/riscos/schedule.c index 285345318..d0d27401c 100644 --- a/riscos/schedule.c +++ b/riscos/schedule.c @@ -128,7 +128,7 @@ void schedule_remove(void (*callback)(void *p), void *p) * Process events up to current time. */ -void schedule_run(void) +bool schedule_run(void) { struct sched_entry *entry; void (*callback)(void *p); @@ -153,4 +153,6 @@ void schedule_run(void) sched_time = sched_queue.next->time; } else sched_active = false; + + return sched_active; }