Commit ae017d29 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #5651, fix a small issue

git-svn-id: file:///svn/toku/tokudb@49477 c7de825b-a66e-492c-adef-691d508d4ae1
parent cd791c32
...@@ -2310,7 +2310,10 @@ static void cachetable_flush_cachefile(CACHETABLE ct, CACHEFILE cf) { ...@@ -2310,7 +2310,10 @@ static void cachetable_flush_cachefile(CACHETABLE ct, CACHEFILE cf) {
PAIR *list = NULL; PAIR *list = NULL;
XMALLOC_N(list_size, list); XMALLOC_N(list_size, list);
ct->list.read_list_lock(); // because we use a linked list head we don't own,
// (the checkpoint thread owns m_checkpoint_head)
// we grab the write list lock here.
ct->list.write_list_lock();
PAIR p; PAIR p;
//Make a list of pairs that belong to this cachefile. //Make a list of pairs that belong to this cachefile.
for (i = 0, p = ct->list.m_checkpoint_head; for (i = 0, p = ct->list.m_checkpoint_head;
...@@ -2325,7 +2328,7 @@ static void cachetable_flush_cachefile(CACHETABLE ct, CACHEFILE cf) { ...@@ -2325,7 +2328,7 @@ static void cachetable_flush_cachefile(CACHETABLE ct, CACHEFILE cf) {
list[num_pairs++] = p; list[num_pairs++] = p;
} }
} }
ct->list.read_list_unlock(); ct->list.write_list_unlock();
// first write out dirty PAIRs // first write out dirty PAIRs
BACKGROUND_JOB_MANAGER bjm = NULL; BACKGROUND_JOB_MANAGER bjm = NULL;
......
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