Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / openldap / dist / include / ldap_rq.h
blobe331cbf566fbfa591f6ff5336f4945c00cd02a4a
1 /* $OpenLDAP: pkg/ldap/include/ldap_rq.h,v 1.14.2.4 2008/02/11 23:26:40 kurt Exp $ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2008 The OpenLDAP Foundation.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License.
11 * A copy of this license is available in file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
16 #ifndef LDAP_RQ_H
17 #define LDAP_RQ_H 1
19 #include <ldap_cdefs.h>
21 LDAP_BEGIN_DECL
23 typedef struct re_s {
24 struct timeval next_sched;
25 struct timeval interval;
26 LDAP_STAILQ_ENTRY(re_s) tnext; /* it includes running */
27 LDAP_STAILQ_ENTRY(re_s) rnext;
28 ldap_pvt_thread_start_t *routine;
29 void *arg;
30 char *tname;
31 char *tspec;
32 } re_t;
34 typedef struct runqueue_s {
35 LDAP_STAILQ_HEAD(l, re_s) task_list;
36 LDAP_STAILQ_HEAD(rl, re_s) run_list;
37 ldap_pvt_thread_mutex_t rq_mutex;
38 } runqueue_t;
40 LDAP_F( struct re_s* )
41 ldap_pvt_runqueue_insert(
42 struct runqueue_s* rq,
43 time_t interval,
44 ldap_pvt_thread_start_t* routine,
45 void *arg,
46 char *tname,
47 char *tspec
50 LDAP_F( struct re_s* )
51 ldap_pvt_runqueue_find(
52 struct runqueue_s* rq,
53 ldap_pvt_thread_start_t* routine,
54 void *arg
57 LDAP_F( void )
58 ldap_pvt_runqueue_remove(
59 struct runqueue_s* rq,
60 struct re_s* entry
63 LDAP_F( struct re_s* )
64 ldap_pvt_runqueue_next_sched(
65 struct runqueue_s* rq,
66 struct timeval* next_run
69 LDAP_F( void )
70 ldap_pvt_runqueue_runtask(
71 struct runqueue_s* rq,
72 struct re_s* entry
75 LDAP_F( void )
76 ldap_pvt_runqueue_stoptask(
77 struct runqueue_s* rq,
78 struct re_s* entry
81 LDAP_F( int )
82 ldap_pvt_runqueue_isrunning(
83 struct runqueue_s* rq,
84 struct re_s* entry
87 LDAP_F( void )
88 ldap_pvt_runqueue_resched(
89 struct runqueue_s* rq,
90 struct re_s* entry,
91 int defer
94 LDAP_F( int )
95 ldap_pvt_runqueue_persistent_backload(
96 struct runqueue_s* rq
99 LDAP_END_DECL
101 #endif