From: Howard Chu Date: Sat, 23 Jan 2016 16:06:32 +0000 (+0000) Subject: ITS#8354 move abandon check X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a9df031d0daef6c5c5325549f18bf7bf5f2614ac;p=openldap ITS#8354 move abandon check --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 583f29b6a8..5213814f9f 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2552,11 +2552,6 @@ syncprov_op_search( Operation *op, SlapReply *rs ) sop->s_inuse = 2; ldap_pvt_thread_mutex_lock( &si->si_ops_mutex ); - if ( op->o_abandon ) { - ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); - ch_free( sop ); - return SLAPD_ABANDON; - } while ( si->si_active ) { /* Wait for active mods to finish before proceeding, as they * may already have inspected the si_ops list looking for @@ -2573,6 +2568,11 @@ syncprov_op_search( Operation *op, SlapReply *rs ) ldap_pvt_thread_yield(); ldap_pvt_thread_mutex_lock( &si->si_ops_mutex ); } + if ( op->o_abandon ) { + ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); + ch_free( sop ); + return SLAPD_ABANDON; + } ldap_pvt_thread_mutex_init( &sop->s_mutex ); sop->s_next = si->si_ops; sop->s_si = si;