test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java

Print this page

        

*** 35,48 **** public class ScheduledTickleService { // We get intermittent ClassCastException if greater than 1 // because of calls to compareTo ! private final static int concurrency = 2; // Record when tasks are done ! public final static CountDownLatch done = new CountDownLatch(concurrency); public static void realMain(String... args) throws InterruptedException { // our tickle service ScheduledExecutorService tickleService = new ScheduledThreadPoolExecutor(concurrency) { --- 35,48 ---- public class ScheduledTickleService { // We get intermittent ClassCastException if greater than 1 // because of calls to compareTo ! private static final int concurrency = 2; // Record when tasks are done ! public static final CountDownLatch done = new CountDownLatch(concurrency); public static void realMain(String... args) throws InterruptedException { // our tickle service ScheduledExecutorService tickleService = new ScheduledThreadPoolExecutor(concurrency) {