From: Howard Chu Date: Sat, 25 Oct 2003 21:13:08 +0000 (+0000) Subject: Add "defer" arg to ldap_pvt_runqueue_resched to suspend scheduling of X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~480 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=45c42630dbe026153f2d07c06982b11dcde7a428;p=openldap Add "defer" arg to ldap_pvt_runqueue_resched to suspend scheduling of a task in the queue without removing it. --- diff --git a/include/ldap_rq.h b/include/ldap_rq.h index de6f32a936..b2f0b43090 100644 --- a/include/ldap_rq.h +++ b/include/ldap_rq.h @@ -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 ) diff --git a/libraries/libldap_r/rq.c b/libraries/libldap_r/rq.c index 16a8111501..e7ba048692 100644 --- a/libraries/libldap_r/rq.c +++ b/libraries/libldap_r/rq.c @@ -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;