diff options
Diffstat (limited to 'storage/tokudb/PerconaFT/ft/serialize/block_table.cc')
-rw-r--r-- | storage/tokudb/PerconaFT/ft/serialize/block_table.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc index 12700d9d83e..811f86c30a7 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc @@ -55,6 +55,11 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "util/nb_mutex.h" #include "util/scoped_malloc.h" + +toku_instr_key *block_table_mutex_key; +toku_instr_key *safe_file_size_lock_mutex_key; +toku_instr_key *safe_file_size_lock_rwlock_key; + // indicates the end of a freelist static const BLOCKNUM freelist_null = {-1}; @@ -100,8 +105,10 @@ void block_table::_create_internal() { memset(&_checkpointed, 0, sizeof(struct translation)); memset(&_mutex, 0, sizeof(_mutex)); _bt_block_allocator = new BlockAllocator(); - toku_mutex_init(&_mutex, nullptr); - nb_mutex_init(&_safe_file_size_lock); + toku_mutex_init(*block_table_mutex_key, &_mutex, nullptr); + nb_mutex_init(*safe_file_size_lock_mutex_key, + *safe_file_size_lock_rwlock_key, + &_safe_file_size_lock); } // Fill in the checkpointed translation from buffer, and copy checkpointed to @@ -129,7 +136,7 @@ int block_table::create_from_buffer( _copy_translation(&_current, &_checkpointed, TRANSLATION_CURRENT); // Determine the file size - int64_t file_size; + int64_t file_size = 0; r = toku_os_get_file_size(fd, &file_size); lazy_assert_zero(r); invariant(file_size >= 0); |