摘要: 创建 Semaphore 实例的时候,需要一个参数 permits, 这个基本上可以确定是设置给 AQS 的 state 的, 然后每个线程调用 acquire 的时候,执行 state = state - 1, release 的时候执行 state = state + 1, 当然,acquire 阅读全文
posted @ 2020-11-13 15:50 六小扛把子 阅读(153) 评论(0) 推荐(0) 编辑