]> git.sur5r.net Git - openldap/commitdiff
ITS#8354 move abandon check
authorHoward Chu <hyc@openldap.org>
Sat, 23 Jan 2016 16:06:32 +0000 (16:06 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 29 Jan 2016 01:00:29 +0000 (19:00 -0600)
servers/slapd/overlays/syncprov.c

index 8d152f1f033b89489ff4efa7df6951e4745de918..457ea95ec7b75e16683ee75a464eeffecbfc64df 100644 (file)
@@ -2554,11 +2554,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
@@ -2575,6 +2570,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;