Commit 503661b6 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

init the ydb_big_lock in the ydb lib init function. addresses #1252

git-svn-id: file:///svn/toku/tokudb.1032b@7955 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4f46b25a
......@@ -19,6 +19,14 @@
static toku_pthread_mutex_t ydb_big_lock = TOKU_PTHREAD_MUTEX_INITIALIZER;
void toku_ydb_lock_init(void) {
int r = toku_pthread_mutex_init(&ydb_big_lock, NULL); assert(r == 0);
}
void toku_ydb_lock_destroy(void) {
int r = toku_pthread_mutex_destroy(&ydb_big_lock); assert(r == 0);
}
void toku_ydb_lock(void) {
int r = toku_pthread_mutex_lock(&ydb_big_lock); assert(r == 0);
}
......
......@@ -42,9 +42,11 @@ const char *toku_copyright_string = "Copyright (c) 2007, 2008 Tokutek Inc. All
const u_int32_t __toku_env_default_max_locks = 1000;
void toku_ydb_init(void) {
toku_ydb_lock_init();
}
void toku_ydb_destroy(void) {
toku_ydb_lock_destroy();
}
/* the ydb reference is used to cleanup the library when there are no more references to it */
......
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