jingtianer / blog_comment

0 stars 0 forks source link

LeetCode-多线程-1 - Jingtianer #100

Open jingtianer opened 8 months ago

jingtianer commented 8 months ago

https://jingtianer.github.io/home/2024/03/04/LeetCode/LeetCode-%E5%A4%9A%E7%BA%BF%E7%A8%8B-%E5%88%B7%E9%A2%98%E6%80%BB%E7%BB%931/

  1. 交替打印 FooBar信号量12345678910111213141516171819202122232425262728293031class FooBar { private int n; private Semaphore fooSem, barSem; public FooBar(int n) { this.n = n;