Skip to content

Commit

Permalink
Merge pull request #96 from code-qote/fix-stream-is-finished-data-race
Browse files Browse the repository at this point in the history
Fixed data race in Stream.IsFInished()
  • Loading branch information
dmcgowan authored Jun 21, 2024
2 parents 478d001 + 6cf8949 commit 0c1fc43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ func (s *Stream) Identifier() uint32 {
// IsFinished returns whether the stream has finished
// sending data
func (s *Stream) IsFinished() bool {
s.finishLock.Lock()
defer s.finishLock.Unlock()
return s.finished
}

Expand Down

0 comments on commit 0c1fc43

Please sign in to comment.