Browse Source

fix go race bug

pull/2262/head
chenxingyu 8 years ago
parent
commit
0d5eca9683
  1. 4
      command/agent/gated_writer.go

4
command/agent/gated_writer.go

@ -29,8 +29,8 @@ func (w *GatedWriter) Flush() {
}
func (w *GatedWriter) Write(p []byte) (n int, err error) {
w.lock.RLock()
defer w.lock.RUnlock()
w.lock.Lock()
defer w.lock.Unlock()
if w.flush {
return w.Writer.Write(p)

Loading…
Cancel
Save