比如:
sema = make(chan struct{}, 1)
和 sema = make(chan struct{})
都是只能放一个元素,读取之前再放的话就会等待
1
iBugOne 2022 年 6 月 21 日 |
2
qianxi0410 2022 年 6 月 21 日
unbuffered channel 会卡发送者,buffer channel 不卡
|