X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fldap_rq.h;h=3f0cb1fe587e226954b436648b0731fd564d873e;hb=9e9bf22a64343e63cda1d0b69679057628c007db;hp=3344f902e1e9c83af972e26abda001490983098a;hpb=580ae073e173019f6334d711ac537fc7df092af1;p=openldap diff --git a/include/ldap_rq.h b/include/ldap_rq.h index 3344f902e1..3f0cb1fe58 100644 --- a/include/ldap_rq.h +++ b/include/ldap_rq.h @@ -1,13 +1,34 @@ /* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2007 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ -#ifdef LDAP_SYNCREPL +#ifndef LDAP_RQ_H +#define LDAP_RQ_H 1 + +#include + +LDAP_BEGIN_DECL typedef struct re_s { struct timeval next_sched; struct timeval interval; LDAP_STAILQ_ENTRY(re_s) tnext; /* it includes running */ LDAP_STAILQ_ENTRY(re_s) rnext; - void *private; + ldap_pvt_thread_start_t *routine; + void *arg; + char *tname; + char *tspec; } re_t; typedef struct runqueue_s { @@ -16,11 +37,21 @@ typedef struct runqueue_s { ldap_pvt_thread_mutex_t rq_mutex; } runqueue_t; -LDAP_F( void ) +LDAP_F( struct re_s* ) ldap_pvt_runqueue_insert( struct runqueue_s* rq, time_t interval, - void *private + ldap_pvt_thread_start_t* routine, + void *arg, + char *tname, + char *tspec +); + +LDAP_F( struct re_s* ) +ldap_pvt_runqueue_find( + struct runqueue_s* rq, + ldap_pvt_thread_start_t* routine, + void *arg ); LDAP_F( void ) @@ -32,7 +63,7 @@ ldap_pvt_runqueue_remove( LDAP_F( struct re_s* ) ldap_pvt_runqueue_next_sched( struct runqueue_s* rq, - struct timeval** next_run + struct timeval* next_run ); LDAP_F( void ) @@ -56,7 +87,15 @@ ldap_pvt_runqueue_isrunning( LDAP_F( void ) ldap_pvt_runqueue_resched( struct runqueue_s* rq, - struct re_s* entry + struct re_s* entry, + int defer +); + +LDAP_F( int ) +ldap_pvt_runqueue_persistent_backload( + struct runqueue_s* rq ); +LDAP_END_DECL + #endif