Commit 3dba058c authored by Rich Prohaska's avatar Rich Prohaska

lock init with set_lk_max_locks. closes #371

git-svn-id: file:///svn/tokudb@2224 c7de825b-a66e-492c-adef-691d508d4ae1
parent f6afc393
...@@ -145,7 +145,8 @@ void DbEnv::set_error_stream(std::ostream *new_error_stream) { ...@@ -145,7 +145,8 @@ void DbEnv::set_error_stream(std::ostream *new_error_stream) {
// locking not yet implemented // locking not yet implemented
int DbEnv::set_lk_max_locks(u_int32_t max_locks) { int DbEnv::set_lk_max_locks(u_int32_t max_locks) {
return 0; int ret = the_env->set_lk_max_locks(the_env, max_locks);
return maybe_throw_error(ret);
} }
int DbEnv::set_lk_max_lockers(u_int32_t max_lockers) { int DbEnv::set_lk_max_lockers(u_int32_t max_lockers) {
......
...@@ -59,6 +59,9 @@ void setup (void) { ...@@ -59,6 +59,9 @@ void setup (void) {
assert(r==0); assert(r==0);
} }
#endif #endif
r = dbenv->set_lk_max_locks(ITEMS_PER_TRANSACTION*2);
assert(r == 0);
if (cachesize) { if (cachesize) {
r = dbenv->set_cachesize(cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1); r = dbenv->set_cachesize(cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1);
if (r != 0) if (r != 0)
......
...@@ -60,6 +60,10 @@ void setup (void) { ...@@ -60,6 +60,10 @@ void setup (void) {
assert(r==0); assert(r==0);
} }
#endif #endif
if (dbenv->set_lk_max_locks) {
r = dbenv->set_lk_max_locks(dbenv, ITEMS_PER_TRANSACTION*2);
assert(r == 0);
}
if (dbenv->set_cachesize) { if (dbenv->set_cachesize) {
r = dbenv->set_cachesize(dbenv, cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1); r = dbenv->set_cachesize(dbenv, cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment