摘要:
多线程生产者和消费者 public class TestDemo { public static void main(String[] args) { ShareData shareData = new ShareData(); new Thread(() -> { for (int i = 0; 阅读全文
posted @ 2022-09-29 17:31
紫川先生
阅读(17)
评论(0)
推荐(0)
摘要:
Semaphore 使用 public class SemaphoreDemo { public static void main(String[] args) { /** * 多线程同时抢多个资源 * permits=1时,相当于锁 * */ Semaphore semaphore = new S 阅读全文
posted @ 2022-09-29 14:22
紫川先生
阅读(20)
评论(0)
推荐(0)

浙公网安备 33010602011771号