From 49e5333ad5a7fe59f28e54a30a4b879ddde1fc63 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sat, 9 Feb 2008 16:54:01 +0000 Subject: [PATCH] lock init with set_lk_max_locks. closes #371 git-svn-id: file:///svn/tokudb@2224 c7de825b-a66e-492c-adef-691d508d4ae1 --- cxx/dbenv.cpp | 3 ++- db-benchmark-test-cxx/db-benchmark-test.cpp | 3 +++ db-benchmark-test/db-benchmark-test.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cxx/dbenv.cpp b/cxx/dbenv.cpp index aa7ae126345..5e09be39503 100644 --- a/cxx/dbenv.cpp +++ b/cxx/dbenv.cpp @@ -145,7 +145,8 @@ void DbEnv::set_error_stream(std::ostream *new_error_stream) { // locking not yet implemented 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) { diff --git a/db-benchmark-test-cxx/db-benchmark-test.cpp b/db-benchmark-test-cxx/db-benchmark-test.cpp index 8571f3bb6dd..eb1bc55e301 100644 --- a/db-benchmark-test-cxx/db-benchmark-test.cpp +++ b/db-benchmark-test-cxx/db-benchmark-test.cpp @@ -59,6 +59,9 @@ void setup (void) { assert(r==0); } #endif + r = dbenv->set_lk_max_locks(ITEMS_PER_TRANSACTION*2); + assert(r == 0); + if (cachesize) { r = dbenv->set_cachesize(cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1); if (r != 0) diff --git a/db-benchmark-test/db-benchmark-test.c b/db-benchmark-test/db-benchmark-test.c index a43299c6ce7..9b3a8318554 100644 --- a/db-benchmark-test/db-benchmark-test.c +++ b/db-benchmark-test/db-benchmark-test.c @@ -60,6 +60,10 @@ void setup (void) { assert(r==0); } #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) { r = dbenv->set_cachesize(dbenv, cachesize / (1024*1024*1024), cachesize % (1024*1024*1024), 1);