3 * Copyright 2003 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted only as authorized by the OpenLDAP
8 * Public License. A copy of this license is available at
9 * http://www.OpenLDAP.org/license.html or in file LICENSE in the
10 * top-level directory of the distribution.
16 #include <ldap_cdefs.h>
21 struct timeval next_sched;
22 struct timeval interval;
23 LDAP_STAILQ_ENTRY(re_s) tnext; /* it includes running */
24 LDAP_STAILQ_ENTRY(re_s) rnext;
25 ldap_pvt_thread_start_t *routine;
29 typedef struct runqueue_s {
30 LDAP_STAILQ_HEAD(l, re_s) task_list;
31 LDAP_STAILQ_HEAD(rl, re_s) run_list;
32 ldap_pvt_thread_mutex_t rq_mutex;
36 ldap_pvt_runqueue_insert(
37 struct runqueue_s* rq,
39 ldap_pvt_thread_start_t* routine,
44 ldap_pvt_runqueue_remove(
45 struct runqueue_s* rq,
49 LDAP_F( struct re_s* )
50 ldap_pvt_runqueue_next_sched(
51 struct runqueue_s* rq,
52 struct timeval** next_run
56 ldap_pvt_runqueue_runtask(
57 struct runqueue_s* rq,
62 ldap_pvt_runqueue_stoptask(
63 struct runqueue_s* rq,
68 ldap_pvt_runqueue_isrunning(
69 struct runqueue_s* rq,
74 ldap_pvt_runqueue_resched(
75 struct runqueue_s* rq,
80 ldap_pvt_runqueue_persistent_backload(