golang 中 锁的错误的用法会致使死锁。

package main import ( "sync" "time" . "github.com/soekchl/myUtils" ) var mux sync.RWMutex func tt() { Notice() mux.Lock() // 3 Notice() defer mux.Unlock() time.Sleep(time.Second * 5) } f
相关文章
相关标签/搜索