瀏覽代碼

event: add missing unlock before panic (#20653)

Boqin Qin 5 年之前
父節點
當前提交
1821328162
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      event/feed.go

+ 1 - 0
event/feed.go

@@ -138,6 +138,7 @@ func (f *Feed) Send(value interface{}) (nsent int) {
 
 	if !f.typecheck(rvalue.Type()) {
 		f.sendLock <- struct{}{}
+		f.mu.Unlock()
 		panic(feedTypeError{op: "Send", got: rvalue.Type(), want: f.etype})
 	}
 	f.mu.Unlock()