This commit is contained in:
suyl
2021-07-30 17:28:50 +08:00
parent 14de70f911
commit 6668ce23c7

View File

@@ -219,7 +219,7 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
} }
func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) { func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
t.RUnlock() t.RLock()
defer t.RUnlock() defer t.RUnlock()
if !t.isExistMsg(printMsg.PrintNo) { if !t.isExistMsg(printMsg.PrintNo) {
t.buildMsgMap(printMsg.PrintNo) t.buildMsgMap(printMsg.PrintNo)
@@ -228,7 +228,7 @@ func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
} }
func (t *TcpClient) addCallbackChan(key, data string) { func (t *TcpClient) addCallbackChan(key, data string) {
t.RUnlock() t.RLock()
defer t.RUnlock() defer t.RUnlock()
if !t.isExistCallback(key) { if !t.isExistCallback(key) {
t.buildCallBackMap(key) t.buildCallBackMap(key)