mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
edit/reader.go: Make race detector happy.
This commit is contained in:
parent
a424136b1d
commit
0fc6c01077
|
@ -79,14 +79,15 @@ func (rd *Reader) ErrorChan() <-chan error {
|
|||
// a separate goroutine.
|
||||
func (rd *Reader) Run() {
|
||||
runes := rd.ar.Chan()
|
||||
rd.quit = make(chan struct{})
|
||||
quit := make(chan struct{})
|
||||
rd.quit = quit
|
||||
go rd.ar.Run()
|
||||
|
||||
for {
|
||||
select {
|
||||
case r := <-runes:
|
||||
rd.readOne(r)
|
||||
case <-rd.quit:
|
||||
case <-quit:
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user