ch4.gs 死锁问题
linzhongxia opened this issue · comments
linzhongxia commented
NestedMonitorLockoutExample类中内部类Helper
方法xGuarededMethod 和 方法xStateChanged 是否应该去掉 synchronized
blocker。callWithGuard(ga)内中lock锁,即使lock.wait.但是NestedMonitorLockoutExample对象锁未释放
perdonare commented
楼上说的对 作者这个地方的synchronized是个bug
Viscent commented
不是问题。这个类,正如其类所示就是为了展示“嵌套监视器锁死”(类似死锁)而写的。参见:
Viscent/JavaConcurrencyPattern#2