fix deadlock bug
This commit is contained in:
parent
6373cc91b7
commit
b2582c0992
@ -61,6 +61,7 @@ func (t *table) pruneRoutes(olderThan time.Duration) {
|
|||||||
// deleteService removes the entire service
|
// deleteService removes the entire service
|
||||||
func (t *table) deleteService(service, network string) {
|
func (t *table) deleteService(service, network string) {
|
||||||
t.Lock()
|
t.Lock()
|
||||||
|
defer t.Unlock()
|
||||||
|
|
||||||
routes, ok := t.routes[service]
|
routes, ok := t.routes[service]
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -86,8 +87,6 @@ func (t *table) deleteService(service, network string) {
|
|||||||
|
|
||||||
// save the routes
|
// save the routes
|
||||||
t.routes[service] = routes
|
t.routes[service] = routes
|
||||||
|
|
||||||
t.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// saveRoutes completely replaces the routes for a service
|
// saveRoutes completely replaces the routes for a service
|
||||||
|
Loading…
Reference in New Issue
Block a user