Skip to content

Commit

Permalink
Defer the unlock.
Browse files Browse the repository at this point in the history
  • Loading branch information
come-maiz committed Jan 4, 2016
1 parent 51dd05d commit f3b399a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subunit.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func (e *Event) write(writer io.Writer) error {
crc := crc32.ChecksumIEEE(b.Bytes())
binary.Write(&b, binary.BigEndian, crc)
m.Lock()
defer m.Unlock()
_, err = writer.Write(b.Bytes())
m.Unlock()
return err
}

Expand Down

0 comments on commit f3b399a

Please sign in to comment.