mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
wake listener when scheduling qtask so it can run immediately
This commit is contained in:
parent
08fe5e7026
commit
7b9fc0e377
@ -949,12 +949,14 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
|
|||||||
so->s_flags |= PS_FIND_BASE;
|
so->s_flags |= PS_FIND_BASE;
|
||||||
}
|
}
|
||||||
if ( so->s_flags & PS_IS_DETACHED ) {
|
if ( so->s_flags & PS_IS_DETACHED ) {
|
||||||
|
int wake=0;
|
||||||
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
|
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
|
||||||
if ( !so->s_qtask ) {
|
if ( !so->s_qtask ) {
|
||||||
so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
|
so->s_qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
|
||||||
syncprov_qtask, so, "syncprov_qtask",
|
syncprov_qtask, so, "syncprov_qtask",
|
||||||
so->s_op->o_conn->c_peer_name.bv_val );
|
so->s_op->o_conn->c_peer_name.bv_val );
|
||||||
++so->s_inuse;
|
++so->s_inuse;
|
||||||
|
wake = 1;
|
||||||
} else {
|
} else {
|
||||||
if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) &&
|
if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) &&
|
||||||
!so->s_qtask->next_sched.tv_sec ) {
|
!so->s_qtask->next_sched.tv_sec ) {
|
||||||
@ -962,9 +964,12 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
|
|||||||
ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 );
|
ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 );
|
||||||
so->s_qtask->interval.tv_sec = RUNQ_INTERVAL;
|
so->s_qtask->interval.tv_sec = RUNQ_INTERVAL;
|
||||||
++so->s_inuse;
|
++so->s_inuse;
|
||||||
|
wake = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
||||||
|
if ( wake )
|
||||||
|
slap_wake_listener();
|
||||||
}
|
}
|
||||||
ldap_pvt_thread_mutex_unlock( &so->s_mutex );
|
ldap_pvt_thread_mutex_unlock( &so->s_mutex );
|
||||||
return LDAP_SUCCESS;
|
return LDAP_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user