Skip to content

Commit

Permalink
删除PageOperationHandlerBase.waitingQueueSize字段
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed Mar 12, 2023
1 parent 83a1f11 commit 5ce1609
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public abstract class PageOperationHandlerBase extends Thread implements PageOpe
protected final ConcurrentLinkedQueue<PageOperation> pageOperations = new ConcurrentLinkedQueue<>();
protected final AtomicLong size = new AtomicLong();
protected final int handlerId;
protected final int waitingQueueSize;
protected final AtomicReferenceArray<PageOperationHandler> waitingHandlers;
protected final AtomicBoolean hasWaitingHandlers = new AtomicBoolean(false);
protected PageOperation lockedTask;
Expand All @@ -28,7 +27,6 @@ public PageOperationHandlerBase(int handlerId, String name, int waitingQueueSize
super(name);
setDaemon(false);
this.handlerId = handlerId;
this.waitingQueueSize = waitingQueueSize;
waitingHandlers = new AtomicReferenceArray<>(waitingQueueSize);
}

Expand Down Expand Up @@ -63,7 +61,7 @@ public void addWaitingHandler(PageOperationHandler handler) {
@Override
public void wakeUpWaitingHandlers() {
if (hasWaitingHandlers.compareAndSet(true, false)) {
for (int i = 0; i < waitingQueueSize; i++) {
for (int i = 0, length = waitingHandlers.length(); i < length; i++) {
PageOperationHandler handler = waitingHandlers.get(i);
if (handler != null) {
handler.wakeUp();
Expand Down

0 comments on commit 5ce1609

Please sign in to comment.