+#if 0 /* causes a deadlock */
+ if ( !si->si_gotcsn ) {
+ sync_control sc, *old;
+ void *ctrls[SLAP_MAX_CIDS];
+ struct berval bv = BER_BVC("1");
+
+ if ( !op->o_controls ) {
+ memset(ctrls, 0, sizeof(ctrls));
+ op->o_controls = ctrls;
+ } else {
+ old = op->o_controls[sync_cid];
+ }
+ op->o_controls[sync_cid] = ≻
+ sc.sr_state.ctxcsn = &bv;
+ syncprov_findcsn( op, FIND_CSN );
+ if ( op->o_controls == ctrls ) {
+ op->o_controls = NULL;
+ } else {
+ op->o_controls[sync_cid] = old;
+ }
+ }
+#endif