mirror of
https://github.com/kidoman/embd
synced 2024-12-22 04:40:04 +01:00
fix fatal error: concurrent map read and map write
This commit is contained in:
parent
bfcd1345fe
commit
6021814731
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user