Skip to content

Commit

Permalink
nouveau: rename variable as it is a new keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
rnewson committed Feb 15, 2024
1 parent a3ca25d commit d05222b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nouveau/src/main/java/org/apache/couchdb/nouveau/core/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ public abstract class Index implements Closeable {
private long updateSeq;
private long purgeSeq;
private boolean deleteOnClose = false;
private final Semaphore permits = new Semaphore(Integer.MAX_VALUE);
private final Semaphore semaphore = new Semaphore(Integer.MAX_VALUE);

protected Index(final long updateSeq, final long purgeSeq) {
this.updateSeq = updateSeq;
this.purgeSeq = purgeSeq;
}

public final boolean tryAcquire() {
return permits.tryAcquire();
return semaphore.tryAcquire();
}

public final void release() {
permits.release();
semaphore.release();
}

public final IndexInfo info() throws IOException {
Expand Down Expand Up @@ -130,9 +130,9 @@ public final synchronized void setPurgeSeq(final long matchSeq, final long purge
@Override
public final void close() throws IOException {
// Ensures exclusive access to the index before closing.
permits.acquireUninterruptibly(Integer.MAX_VALUE);
semaphore.acquireUninterruptibly(Integer.MAX_VALUE);
doClose();
// Never release permits.
// Never release semaphore.
}

protected abstract void doClose() throws IOException;
Expand All @@ -146,7 +146,7 @@ public synchronized void setDeleteOnClose(final boolean deleteOnClose) {
}

public final boolean isActive() {
return permits.availablePermits() < Integer.MAX_VALUE || permits.hasQueuedThreads();
return semaphore.availablePermits() < Integer.MAX_VALUE || semaphore.hasQueuedThreads();
}

protected final void assertUpdateSeqProgress(final long matchSeq, final long updateSeq)
Expand Down

0 comments on commit d05222b

Please sign in to comment.