为什么Thread.stop()不安全?

因为这个方法会释放wait-notify相关的monitor(锁),可能导致不应该出现的并发访问,导致有的数据进入不一致状态。

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.