From 60218147312c0f5550bfca018a579639cae41b51 Mon Sep 17 00:00:00 2001 From: gotang Date: Sat, 20 Aug 2016 14:10:49 +0800 Subject: [PATCH] fix fatal error: concurrent map read and map write --- host/generic/interrupt.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 4052283..7f9b766 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -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