在的JCiP书中,如果任何Thread t被中断,这段代码是否将永远等待(因为startGate.await()可能抛出InterruptedException),所以endGate闩锁永远不会被释放?public long timeTasks(int nThreads, final Runnable task) final CountDownLatch startGate = new CountDownLatch(1);
final Co
示例的最终版本显示了类Memoizer (pg 108)的实现,其中显示了这样一个缓存。我想知道为什么这个类没有用@ThreadSafe注解?不过,Memoizer似乎是线程安全的。以下是Memoizer的代码:private final ConcurrentMapFuture<V>> cache
= new ConcurrentHashMap<A,