make schedule_run return if it has active jobs to schedule

svn path=/trunk/netsurf/; revision=6447
This commit is contained in:
Vincent Sanders 2009-02-11 22:33:55 +00:00
parent 5060882795
commit cbf07e1bc3
6 changed files with 15 additions and 10 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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

View File

@ -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)

View File

@ -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;
}

View File

@ -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;
}