Made MemoryAwareThreadPoolExecutor.shouldCount() extensible
This commit is contained in:
parent
85dc8f93f5
commit
7de92967c2
@ -367,7 +367,13 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
|||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean shouldCount(Runnable task) {
|
/**
|
||||||
|
* Returns {@code true} if and only if the specified {@code task} should
|
||||||
|
* be counted to limit the global and per-channel memory consumption.
|
||||||
|
* To override this method, you must call {@code super.shouldCount()} to
|
||||||
|
* make sure important tasks are not counted.
|
||||||
|
*/
|
||||||
|
protected boolean shouldCount(Runnable task) {
|
||||||
if (task instanceof Executor) {
|
if (task instanceof Executor) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user