diff --git a/quasar-core/src/main/java/co/paralleluniverse/concurrent/util/ScheduledSingleThreadExecutor.java b/quasar-core/src/main/java/co/paralleluniverse/concurrent/util/ScheduledSingleThreadExecutor.java index ba59da4d16..50b1cbd8e1 100644 --- a/quasar-core/src/main/java/co/paralleluniverse/concurrent/util/ScheduledSingleThreadExecutor.java +++ b/quasar-core/src/main/java/co/paralleluniverse/concurrent/util/ScheduledSingleThreadExecutor.java @@ -710,7 +710,7 @@ public List shutdownNow() { public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long millis = TimeUnit.MILLISECONDS.convert(nanos, TimeUnit.NANOSECONDS); - worker.join(millis, (int) (nanos - millis)); + worker.join(millis, (int) (nanos - millis * 1000000)); return !worker.isAlive(); } @@ -742,4 +742,4 @@ public int getPoolSize() { public int getActiveCount() { return 1; } -} \ No newline at end of file +} diff --git a/quasar-core/src/main/java/co/paralleluniverse/fibers/JMXFibersMonitor.java b/quasar-core/src/main/java/co/paralleluniverse/fibers/JMXFibersMonitor.java index 9bc0375f9e..d0b398fef0 100644 --- a/quasar-core/src/main/java/co/paralleluniverse/fibers/JMXFibersMonitor.java +++ b/quasar-core/src/main/java/co/paralleluniverse/fibers/JMXFibersMonitor.java @@ -217,6 +217,9 @@ else if (t.getState() == Thread.State.RUNNABLE) @Override public Map getRunawayFibers() { Map map = new HashMap<>(); + if (problemFibers == null) { + return map; + } for (Map.Entry e : problemFibers.entrySet()) map.put(e.getKey().toString(), Strand.toString(e.getValue())); return map;