Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Aug 5, 2024
1 parent 4c796a5 commit c368c81
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ public class AsyncPositionOutputStream extends PositionOutputStream {
private final AtomicReference<Throwable> exception;
private final Future<?> future;

private volatile boolean isClosed;
private long position;

public AsyncPositionOutputStream(PositionOutputStream out) {
this.out = out;
this.eventQueue = new LinkedBlockingQueue<>();
this.exception = new AtomicReference<>();
this.isClosed = false;
this.position = 0;
this.future = EXECUTOR_SERVICE.submit(this::execute);
}
Expand All @@ -65,7 +63,7 @@ private void execute() {

private void doWork() throws InterruptedException, IOException {
try {
while (!isClosed) {
while (true) {
AsyncEvent event = eventQueue.poll(AWAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
if (event == null) {
continue;
Expand Down Expand Up @@ -144,8 +142,6 @@ public void close() throws IOException {
throw new RuntimeException(e);
} catch (ExecutionException e) {
throw new RuntimeException(e);
} finally {
isClosed = true;
}
}

Expand Down

0 comments on commit c368c81

Please sign in to comment.