Skip to content
Myr

Ignore EvtReadNew if EvtReadFin is already set

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 941b0a0 · Browse files · 2 files+3 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−8 removed

  • other:+3 added−8 removed

2 files+3 added−8 removed

modified:src/util/eventbox.go-7 removed
43 unmodified lines
44 }45 b.cond.L.Unlock()46}4748// Unset turns off the event type on the box49func (b *EventBox) Unset(event EventType) {50 b.cond.L.Lock()51 delete(b.events, event)52 b.cond.L.Unlock()53}5448// Clear clears the events49// Unsynchronized; should be called within Wait routine50func (events *Events) Clear() {51 for event := range *events {
45 unmodified lines
modified:src/core.go+3 added-1 removed
186 unmodified lines
187 // Synchronous search188 if opts.Sync {189 eventBox.Unwatch(EvtReadNew)190 eventBox.WaitFor(EvtReadFin)191 eventBox.Unset(EvtReadNew)191 }192193 // Go interactive194 go matcher.Loop()
13 unmodified lines
208 for {209 delay := true210 ticks++211 eventBox.Wait(func(events *util.Events) {212 if _, fin := (*events)[EvtReadFin]; fin {213 delete(*events, EvtReadNew)214 }215 for evt, value := range *events {216 switch evt {217218 case EvtReadNew, EvtReadFin:
68 unmodified lines