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

refs #5833 don't return from allocate_counter without unlocking


git-svn-id: file:///svn/toku/tokudb@51425 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3a01c743
......@@ -210,17 +210,21 @@ static uint64_t allocate_counter (void)
// Effect: Find an unused counter number, and allocate it, returning the counter number.
// Grabs the pc_lock.
{
uint64_t ret;
pc_lock();
size_t size = counters_in_use.get_size();
for (uint64_t i=0; i<size; i++) {
if (!counters_in_use.fetch_unchecked(i)) {
counters_in_use.store_unchecked(i, true);
return i;
ret = i;
goto unlock;
}
}
counters_in_use.push(true);
ret = size;
unlock:
pc_unlock();
return size;
return ret;
}
......
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