Browse Source

refs #5965 fix some mutex initializations

git-svn-id: file:///svn/toku/tokudb@52884 c7de825b-a66e-492c-adef-691d508d4ae1
pull/73/head
Leif Walsh 13 years ago
committed by Yoni Fogel
parent
commit
a1d664f010
  1. 2
      ft/txn_child_manager.cc
  2. 4
      locktree/locktree.cc
  3. 4
      locktree/manager.cc

2
ft/txn_child_manager.cc

@ -16,7 +16,7 @@ void txn_child_manager::init(TOKUTXN root) {
invariant(root->parent == NULL);
m_root = root;
m_last_xid = TXNID_NONE;
m_mutex = ZERO_MUTEX_INITIALIZER;
ZERO_STRUCT(m_mutex);
toku_pthread_mutexattr_t attr;
toku_mutexattr_init(&attr);

4
locktree/locktree.cc

@ -8,6 +8,7 @@
#include <util/growable_array.h>
#include <portability/toku_pthread.h>
#include <portability/toku_time.h>
#include "locktree.h"
@ -49,7 +50,8 @@ void locktree::create(manager::memory_tracker *mem_tracker, DICTIONARY_ID dict_i
m_sto_score = STO_SCORE_THRESHOLD;
m_lock_request_info.pending_lock_requests.create();
m_lock_request_info.mutex = TOKU_MUTEX_INITIALIZER;
ZERO_STRUCT(m_lock_request_info.mutex);
toku_mutex_init(&m_lock_request_info.mutex, nullptr);
m_lock_request_info.should_retry_lock_requests = false;
// Threads read the should retry bit without a lock

4
locktree/manager.cc

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <string.h>
#include <portability/toku_pthread.h>
#include "locktree.h"
@ -20,7 +21,8 @@ void locktree::manager::create(lt_create_cb create_cb, lt_destroy_cb destroy_cb)
m_locktree_map.create();
m_lt_create_callback = create_cb;
m_lt_destroy_callback = destroy_cb;
m_mutex = TOKU_MUTEX_INITIALIZER;
ZERO_STRUCT(m_mutex);
toku_mutex_init(&m_mutex, nullptr);
}
void locktree::manager::destroy(void) {

Loading…
Cancel
Save