我在一些代码中使用ThreadPoolExecutor,并为它提供了一个BlockingQueue<Runnable>。我得到一个编译器错误说can't resolve constructor。但是,通过ThreadPoolExecutor的构造函数,我得到了一个编译器错误:public class Test {
我正在使用thread pool executor,我观察到当我使用PriorityBlockingQueue时,它会在下面的代码中抛出ClassCastException,如果我在下面的代码中选择LinkedBlockingQueue而不是PriorityBlockingQueue,一切都会正常工作。{
ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 10, TimeUnit.MINUTES, new PriorityB