golang 锁bug 记录

package routes import ( "fmt" "sync" "testing" "time" ) var all_lock_test sync.RWMutex func TestSendGiftInfo_SendBlind(t *testing.T) { if !all_lock_test.TryRLock() { return } defer all_lock_test.RUnlock() go func() { all_lock_test.Lock() defer all_lock_test.Unlock() fmt.Println("配置更新") }() time.Sleep(time.Second) rDeal() } func rDeal() { all_lock_test.RLock() defer all_lock_test.RUnlock() fmt.Println("处理业务完毕") }
上一篇:Github 2024-04-21 开源项目日报 Top10


下一篇:verilog 从入门到看得懂---matlab 自动生成verilog