From 7486ef93dff85dcc38a0beea832112a36f0f7adc Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 2 Oct 2005 12:28:50 +0000 Subject: [PATCH] Tweak prev commit, avoid rescheduling running qtask --- servers/slapd/overlays/syncprov.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 5d639404f3..1a86368692 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -70,6 +70,7 @@ typedef struct syncops { struct syncres *s_res; struct syncres *s_restail; struct re_s *s_qtask; /* task for playing psearch responses */ +#define RUNQ_INTERVAL 36000 /* a long time */ ldap_pvt_thread_mutex_t s_mutex; } syncops; @@ -900,14 +901,14 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode ) if ( so->s_flags & PS_IS_DETACHED ) { ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); if ( !so->s_qtask ) { - so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, 1, + so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL, syncprov_qtask, so, "syncprov_qtask", so->s_op->o_conn->c_peer_name.bv_val ); } else { if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask )) { so->s_qtask->interval.tv_sec = 0; ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 ); - so->s_qtask->interval.tv_sec = 1; + so->s_qtask->interval.tv_sec = RUNQ_INTERVAL; } } ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex ); -- 2.39.5