]> git.sur5r.net Git - openldap/commitdiff
Add "defer" arg to ldap_pvt_runqueue_resched to suspend scheduling of
authorHoward Chu <hyc@openldap.org>
Sat, 25 Oct 2003 21:13:08 +0000 (21:13 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 25 Oct 2003 21:13:08 +0000 (21:13 +0000)
a task in the queue without removing it.

include/ldap_rq.h
libraries/libldap_r/rq.c

index de6f32a936b49dbbd81edba71c910a94de911e24..b2f0b43090c43e223640183e6954955dfdb12e8f 100644 (file)
@@ -73,7 +73,8 @@ 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 )
index 16a81115016b85fb4bac5289c42c2e57581d521c..e7ba0486929c41d7733757892904c32caf53c8b2 100644 (file)
@@ -118,7 +118,8 @@ ldap_pvt_runqueue_isrunning(
 void 
 ldap_pvt_runqueue_resched(
        struct runqueue_s* rq,
-       struct re_s* entry
+       struct re_s* entry,
+       int defer
 )
 {
        struct re_s* prev;
@@ -133,7 +134,7 @@ ldap_pvt_runqueue_resched(
 
        LDAP_STAILQ_REMOVE( &rq->task_list, entry, re_s, tnext );
 
-       if ( entry->interval.tv_sec ) {
+       if ( entry->interval.tv_sec && !defer ) {
                entry->next_sched.tv_sec = time( NULL ) + entry->interval.tv_sec;
        } else {
                entry->next_sched.tv_sec = 0;