我这样理解:互斥锁:读写锁;是否正确;网上看的晕头转向
func TestLock() {
/*互斥锁`````````````````````````````````````````````````````````````````````````````````````````````*/
var m sync.Mutex
for i := 0; i
go func(i int) { //加锁|解锁:多个互斥锁也是阻塞的
m.Lock()
原创
2018-04-03 09:30:12 ·
141 阅读 ·
0 评论