Diff for /servers/slapd/overlays/syncprov.c between versions 1.147.2.58 and 1.147.2.59

version 1.147.2.58, 2009/04/05 01:29:48 version 1.147.2.59, 2009/10/30 18:19:13
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.147.2.57 2009/03/17 16:39:20 quanah Exp $ */  /* $OpenLDAP$ */
 /* syncprov.c - syncrepl provider */  /* syncprov.c - syncrepl provider */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
Line 1324  syncprov_op_cleanup( Operation *op, Slap Line 1324  syncprov_op_cleanup( Operation *op, Slap
         /* Remove op from lock table */          /* Remove op from lock table */
         mt = opc->smt;          mt = opc->smt;
         if ( mt ) {          if ( mt ) {
                 modinst *mi = mt->mt_mods;                  ldap_pvt_thread_mutex_lock( &mt->mt_mutex );
                   mt->mt_mods = mt->mt_mods->mi_next;
                 /* If there are more, promote the next one */                  /* If there are more, promote the next one */
                 if ( mi->mi_next ) {                  if ( mt->mt_mods ) {
                         ldap_pvt_thread_mutex_lock( &mt->mt_mutex );  
                         mt->mt_mods = mi->mi_next;  
                         mt->mt_op = mt->mt_mods->mi_op;                          mt->mt_op = mt->mt_mods->mi_op;
                         ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );                          ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                 } else {                  } else {
                           ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                         ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );                          ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );
                         avl_delete( &si->si_mods, mt, sp_avl_cmp );                          avl_delete( &si->si_mods, mt, sp_avl_cmp );
                         ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );                          ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
Line 1946  syncprov_op_mod( Operation *op, SlapRepl Line 1945  syncprov_op_mod( Operation *op, SlapRepl
                 mt = avl_find( si->si_mods, &mtdummy, sp_avl_cmp );                  mt = avl_find( si->si_mods, &mtdummy, sp_avl_cmp );
                 if ( mt ) {                  if ( mt ) {
                         ldap_pvt_thread_mutex_lock( &mt->mt_mutex );                          ldap_pvt_thread_mutex_lock( &mt->mt_mutex );
                           if ( mt->mt_mods == NULL ) {
                                   /* Cannot reuse this mt, as another thread is about
                                    * to release it in syncprov_op_cleanup.
                                    */
                                   ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                                   mt = NULL;
                           }
                   }
                   if ( mt ) {
                         ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );                          ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
                         mt->mt_tail->mi_next = mi;                          mt->mt_tail->mi_next = mi;
                         mt->mt_tail = mi;                          mt->mt_tail = mi;

Removed from v.1.147.2.58  
changed lines
  Added in v.1.147.2.59


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org