摘要: ReentrantLock 与synchronized相比有以下特点 可中断 可以设置为公平锁 支持多个条件变量 与sychronized一样的 支持可重入锁 可打断锁(避免死锁):使用lockInterruptibly()方法 public class TestReentrant { privat 阅读全文
posted @ 2024-06-09 20:50 csm~/ 阅读(1) 评论(0) 推荐(0) 编辑