break;
}
}
- my->mc_wlen[toggle] = wsize;
if (rc) {
my->mc_status = rc;
pthread_mutex_unlock(&my->mc_mutex[toggle]);
my->mc_olen[toggle] = 0;
goto again;
}
+ my->mc_wlen[toggle] = 0;
toggle ^= 1;
}
return (THREAD_RET)0;
pthread_mutex_unlock(&my->mc_mutex[toggle]);
return my->mc_status;
}
- my->mc_wlen[toggle] = 0;
- my->mc_olen[toggle] = 0;
my->mc_toggle = toggle;
return 0;
}
int rc, toggle;
unsigned int i;
+ /* Empty DB, nothing to do */
+ if (*pg == P_INVALID)
+ return MDB_SUCCESS;
+
mc.mc_snum = 1;
mc.mc_top = 0;
mc.mc_txn = txn;
my.mc_env = env;
my.mc_fd = fd;
pthread_mutex_lock(&my.mc_mutex[0]);
+ THREAD_CREATE(thr, mdb_env_copythr, &my);
/* Do the lock/unlock of the reader mutex before starting the
* write txn. Otherwise other read txns could block writers.
}
my.mc_wlen[0] = env->me_psize * 2;
my.mc_txn = txn;
- THREAD_CREATE(thr, mdb_env_copythr, &my);
rc = mdb_env_cwalk(&my, &txn->mt_dbs[1].md_root, 0);
if (rc == MDB_SUCCESS && my.mc_wlen[my.mc_toggle])
rc = mdb_env_cthr_toggle(&my);