Update BoundedExecutorServiceImpl.java
This commit is contained in:
parent
c852ce4c2b
commit
cd543cad94
@ -64,14 +64,16 @@ class BoundedExecutorServiceImpl extends ThreadPoolExecutor implements BoundedEx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
var queueSize = getQueue().size();
|
|
||||||
synchronized (queueSizeStatusLock) {
|
|
||||||
if (queueSizeStatus != null) queueSizeStatus.accept(queueSize >= maxQueueSize, queueSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeExecute(Thread t, Runnable r) {
|
public void beforeExecute(Thread t, Runnable r) {
|
||||||
|
|
||||||
|
var queueSize = getQueue().size();
|
||||||
|
synchronized (queueSizeStatusLock) {
|
||||||
|
if (queueSizeStatus != null) queueSizeStatus.accept(queueSize >= maxQueueSize, queueSize);
|
||||||
|
}
|
||||||
|
|
||||||
semaphore.release();
|
semaphore.release();
|
||||||
|
|
||||||
super.beforeExecute(t, r);
|
super.beforeExecute(t, r);
|
||||||
|
Loading…
Reference in New Issue
Block a user