소스 검색

Update stdio_handle.go (#52)

fix
fatal error: concurrent map iteration and map write
kuangzhiqiang 4 달 전
부모
커밋
ff2923fa94
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      internal/core/plugin_manager/local_runtime/stdio_handle.go

+ 2 - 0
internal/core/plugin_manager/local_runtime/stdio_handle.go

@@ -97,6 +97,8 @@ func (s *stdioHolder) StartStdout(notify_heartbeat func()) {
 				for _, listener := range listeners {
 					listener(s.id, data)
 				}
+				s.l.Lock()
+				defer s.l.Unlock()
 				for listener_session_id, listener := range s.listener {
 					if listener_session_id == session_id {
 						listener(data)