Log executor pending tasks

This commit is contained in:
M66B 2020-04-05 14:10:19 +02:00
parent 363e206a24
commit 8eb38aefef
1 changed files with 6 additions and 1 deletions

View File

@ -215,7 +215,7 @@ public class Helper {
}
private static class ThreadPoolExecutorEx extends ThreadPoolExecutor {
String name;
private String name;
public ThreadPoolExecutorEx(
String name,
@ -231,6 +231,11 @@ public class Helper {
protected void beforeExecute(Thread t, Runnable r) {
Log.d("Executing " + t.getName());
}
@Override
protected void afterExecute(Runnable r, Throwable t) {
Log.d("Executed " + name + " pending=" + getQueue().size());
}
}
private static class PriorityFuture<T> implements RunnableFuture<T> {