adds missing mutex around callback map (#54)
We were missing a mutex when retrieving the caller in callback(). Triggered a test failure here: https://travis-ci.org/digitalocean/go-libvirt/jobs/317051310
This commit is contained in:
parent
fa865cdb8e
commit
1a220100bd
2
rpc.go
2
rpc.go
@ -208,7 +208,9 @@ func (l *Libvirt) listen() {
|
||||
|
||||
// callback sends rpc responses to their respective caller.
|
||||
func (l *Libvirt) callback(id uint32, res response) {
|
||||
l.cm.Lock()
|
||||
c, ok := l.callbacks[id]
|
||||
l.cm.Unlock()
|
||||
if ok {
|
||||
c <- res
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user