ldap_pvt_thread_rdwr_t si_csn_rwlock;
ldap_pvt_thread_mutex_t si_ops_mutex;
ldap_pvt_thread_mutex_t si_mods_mutex;
+ ldap_pvt_thread_mutex_t si_resp_mutex;
} syncprov_info_t;
typedef struct opcookie {
char cbuf[LDAP_PVT_CSNSTR_BUFSIZE];
int do_check = 0, have_psearches, foundit, csn_changed = 0;
+ ldap_pvt_thread_mutex_lock( &si->si_resp_mutex );
+
/* Update our context CSN */
cbuf[0] = '\0';
maxcsn.bv_val = cbuf;
}
}
}
- return SLAP_CB_CONTINUE;
+ goto leave;
}
slap_get_commit_csn( op, &maxcsn, &foundit );
/* Don't do any processing for consumer contextCSN updates */
if ( op->o_dont_replicate ) {
ldap_pvt_thread_rdwr_wunlock( &si->si_csn_rwlock );
- return SLAP_CB_CONTINUE;
+ goto leave;
}
si->si_numops++;
if ( si->si_logs && op->o_tag != LDAP_REQ_ADD ) {
syncprov_add_slog( op );
}
-
+leave: ldap_pvt_thread_mutex_unlock( &si->si_resp_mutex );
}
return SLAP_CB_CONTINUE;
}
ldap_pvt_thread_rdwr_init( &si->si_csn_rwlock );
ldap_pvt_thread_mutex_init( &si->si_ops_mutex );
ldap_pvt_thread_mutex_init( &si->si_mods_mutex );
+ ldap_pvt_thread_mutex_init( &si->si_resp_mutex );
csn_anlist[0].an_desc = slap_schema.si_ad_entryCSN;
csn_anlist[0].an_name = slap_schema.si_ad_entryCSN->ad_cname;
ber_bvarray_free( si->si_ctxcsn );
if ( si->si_sids )
ch_free( si->si_sids );
+ ldap_pvt_thread_mutex_destroy( &si->si_resp_mutex );
ldap_pvt_thread_mutex_destroy( &si->si_mods_mutex );
ldap_pvt_thread_mutex_destroy( &si->si_ops_mutex );
ldap_pvt_thread_rdwr_destroy( &si->si_csn_rwlock );