fixed a bug in PrioritizedThreadPoolExecutor:

now execute(Runnable) verifies the command is added as Comparable
This commit is contained in:
uboness 2013-02-09 03:33:12 +01:00
parent 678a8664f6
commit eef3610e12
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ public class PrioritizedEsThreadPoolExecutor extends EsThreadPoolExecutor {
@Override @Override
public void execute(Runnable command) { public void execute(Runnable command) {
if (!(command instanceof PrioritizedRunnable)) { if (!(command instanceof Comparable)) {
command = PrioritizedRunnable.wrap(command, Priority.NORMAL); command = PrioritizedRunnable.wrap(command, Priority.NORMAL);
} }
super.execute(command); super.execute(command);