Skip to content

Commit

Permalink
Update oviewer/document.go
Browse files Browse the repository at this point in the history
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
  • Loading branch information
noborus and ccoVeille authored Dec 26, 2024
1 parent 05d0c46 commit c336015
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oviewer/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,10 @@ func (m *Document) storeEndNum() int {
func (m *Document) WaitEOF() {
m.cond.L.Lock()
defer m.cond.L.Unlock()
if atomic.LoadInt32(&m.store.eof) == 0 {
m.cond.Wait()
if m.BufEOF() {
return
}
m.cond.Wait()
}

// BufEOF return true if EOF is reached.
Expand Down

0 comments on commit c336015

Please sign in to comment.