]> git.sur5r.net Git - openldap/commitdiff
Fix modify serialization
authorHoward Chu <hyc@openldap.org>
Sat, 27 Nov 2004 08:55:04 +0000 (08:55 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 27 Nov 2004 08:55:04 +0000 (08:55 +0000)
servers/slapd/overlays/syncprov.c

index f6f414aa1c44b3f20818abcbbb33764ca41e86a4..d25b22aca6c69cd8259bd718b962383b74bb5b6e 100644 (file)
@@ -970,6 +970,7 @@ syncprov_op_cleanup( Operation *op, SlapReply *rs )
        mtdummy.mt_op = op;
        ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );
        mt = avl_find( si->si_mods, &mtdummy, sp_avl_cmp );
+       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
        if ( mt ) {
                modinst *mi = mt->mt_mods;
                
@@ -980,13 +981,14 @@ syncprov_op_cleanup( Operation *op, SlapReply *rs )
                        mt->mt_op = mt->mt_mods->mi_op;
                        ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                } else {
+                       ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );
                        avl_delete( &si->si_mods, mt, sp_avl_cmp );
+                       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
                        ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                        ldap_pvt_thread_mutex_destroy( &mt->mt_mutex );
                        ch_free( mt );
                }
        }
-       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
        op->o_callback = cb->sc_next;
        op->o_tmpfree(cb, op->o_tmpmemctx);
 }