Search Results

Search found 1 results on 1 pages for 'moonese'.

Page 1/1 | 1 

  • Why thread started by ScheduledExecutorService.schedule() never quits?

    - by moonese
    If I create a scheduled task by calling ScheduledExecutorService.schedule(), it never quits after execution, is it a JDK bug, or I just miss something? note: doSomething() is empty method below. public static void doSomething() { } public static void main(String[] args) { ScheduledFuture scheduleFuture = Executors.newSingleThreadScheduledExecutor().schedule(new Callable() { public Void call() { try { doSomething(); } catch (Exception e) { e.printStackTrace(); } return null; } }, 1, TimeUnit.SECONDS); }

    Read the article

1