]> 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)
committerHoward Chu <hyc@openldap.org>
Sat, 23 Jan 2016 16:06:32 +0000 (16:06 +0000)
servers/slapd/overlays/syncprov.c

index 583f29b6a8747ecf098f6cf75391456c78b7a5b8..5213814f9f72dbdf5033aa01bf351cceac0bb3d6 100644 (file)
@@ -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;