coarser lock granularity

- get rid of individual Peer locks
- hold Peers read (or write) lock and LocalPeer read lock while
  performing route calculations

This eliminates the deadlock resulting from the inconsistent lock
acquisition order in route calculcation.

Fixes #643.
This commit is contained in:
Matthias Radestock committed 2015-05-11 17:19:54 +01:00
1 parent 5bd8730353
commit e246e6acc6
4 files changed
+16 -22

No files matched your search

+2
View File
@@ -4,10 +4,12 @@ import (
"fmt"
"log"
"net"
"sync"
"time"
)
type LocalPeer struct {
sync.RWMutex
*Peer
router *Router
actionChan chan<- LocalPeerAction