Commit a1d664f0 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5965 fix some mutex initializations


git-svn-id: file:///svn/toku/tokudb@52884 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6e846987
...@@ -16,7 +16,7 @@ void txn_child_manager::init(TOKUTXN root) { ...@@ -16,7 +16,7 @@ void txn_child_manager::init(TOKUTXN root) {
invariant(root->parent == NULL); invariant(root->parent == NULL);
m_root = root; m_root = root;
m_last_xid = TXNID_NONE; m_last_xid = TXNID_NONE;
m_mutex = ZERO_MUTEX_INITIALIZER; ZERO_STRUCT(m_mutex);
toku_pthread_mutexattr_t attr; toku_pthread_mutexattr_t attr;
toku_mutexattr_init(&attr); toku_mutexattr_init(&attr);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <util/growable_array.h> #include <util/growable_array.h>
#include <portability/toku_pthread.h>
#include <portability/toku_time.h> #include <portability/toku_time.h>
#include "locktree.h" #include "locktree.h"
...@@ -49,7 +50,8 @@ void locktree::create(manager::memory_tracker *mem_tracker, DICTIONARY_ID dict_i ...@@ -49,7 +50,8 @@ void locktree::create(manager::memory_tracker *mem_tracker, DICTIONARY_ID dict_i
m_sto_score = STO_SCORE_THRESHOLD; m_sto_score = STO_SCORE_THRESHOLD;
m_lock_request_info.pending_lock_requests.create(); 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; m_lock_request_info.should_retry_lock_requests = false;
// Threads read the should retry bit without a lock // Threads read the should retry bit without a lock
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <portability/toku_pthread.h>
#include "locktree.h" #include "locktree.h"
...@@ -20,7 +21,8 @@ void locktree::manager::create(lt_create_cb create_cb, lt_destroy_cb destroy_cb) ...@@ -20,7 +21,8 @@ void locktree::manager::create(lt_create_cb create_cb, lt_destroy_cb destroy_cb)
m_locktree_map.create(); m_locktree_map.create();
m_lt_create_callback = create_cb; m_lt_create_callback = create_cb;
m_lt_destroy_callback = destroy_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) { void locktree::manager::destroy(void) {
......
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