Skip to content

Commit

Permalink
Delete zstdLock
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Jan 19, 2024
1 parent c11ef8f commit 1d73f51
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions boot/src/main/java/org/glavo/japp/boot/JAppReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;

public final class JAppReader implements DecompressContext, Closeable {
private static final int MAX_ARRAY_LENGTH = Integer.MAX_VALUE - 8;
Expand Down Expand Up @@ -191,8 +190,6 @@ public static JAppBootArgs openSystemReader(ByteBuffer bootArgs) throws IOExcept
return args;
}

private final ReentrantLock zstdLock = new ReentrantLock();

private final FileChannel channel;
private final long baseOffset;

Expand Down Expand Up @@ -245,13 +242,8 @@ public ByteArrayPool getPool() {
}

@Override
public void decompressZstd(ByteBuffer input, ByteBuffer output) {
zstdLock.lock();
try {
decompressor.decompress(input, output);
} finally {
zstdLock.unlock();
}
public synchronized void decompressZstd(ByteBuffer input, ByteBuffer output) {
decompressor.decompress(input, output);
}

public Map<String, JAppResourceGroup> getRoot(JAppResourceRoot root) {
Expand Down

0 comments on commit 1d73f51

Please sign in to comment.