mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Fix deadlock when reconfiguring multicast
This commit is contained in:
parent
88925d3e06
commit
2ef823e69c
2 changed files with 11 additions and 6 deletions
|
@ -76,14 +76,17 @@ func (l *link) init(c *Core) error {
|
|||
go func() {
|
||||
for {
|
||||
e := <-l.reconfigure
|
||||
response := make(chan error)
|
||||
l.tcp.reconfigure <- response
|
||||
if err := <-response; err != nil {
|
||||
tcpresponse := make(chan error)
|
||||
awdlresponse := make(chan error)
|
||||
l.tcp.reconfigure <- tcpresponse
|
||||
if err := <-tcpresponse; err != nil {
|
||||
e <- err
|
||||
continue
|
||||
}
|
||||
l.awdl.reconfigure <- response
|
||||
if err := <-response; err != nil {
|
||||
l.awdl.reconfigure <- awdlresponse
|
||||
if err := <-awdlresponse; err != nil {
|
||||
e <- err
|
||||
continue
|
||||
}
|
||||
e <- nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue