Merge pull request #4 from gotang/master

fix fatal error: concurrent map read and map write
This commit is contained in:
Thorsten von Eicken 2016-09-05 23:36:21 -07:00 committed by GitHub
commit 49e6cc504d
1 changed files with 2 additions and 0 deletions

View File

@ -61,11 +61,13 @@ func initEpollListener() *epollListener {
if err != nil {
panic(fmt.Sprintf("EpollWait error: %v", err))
}
listener.mu.Lock()
for i := 0; i < n; i++ {
if irq, ok := listener.interruptablePins[int(epollEvents[i].Fd)]; ok {
irq.Signal()
}
}
listener.mu.Unlock()
}
}()
return listener