Skip to content

Commit

Permalink
protect FileStore.deadChunks against race codition
Browse files Browse the repository at this point in the history
  • Loading branch information
andreitokar committed Aug 22, 2023
1 parent 1fbf735 commit 57d2332
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions h2/src/main/org/h2/mvstore/FileStore.java
Expand Up @@ -14,7 +14,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
Expand All @@ -33,6 +32,7 @@
import java.util.TreeMap;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -194,7 +194,7 @@ public abstract class FileStore<C extends Chunk<C>>
*/
private MVMap<String, String> layout;

private final Deque<C> deadChunks = new ArrayDeque<>();
private final Deque<C> deadChunks = new ConcurrentLinkedDeque<>();

/**
* Reference to a background thread, which is expected to be running, if any.
Expand Down

0 comments on commit 57d2332

Please sign in to comment.