Skip to content
Snippets Groups Projects
Commit 0ba5ac9f authored by Ian Luo's avatar Ian Luo
Browse files

correct unlock

parent f448a516
No related branches found
No related tags found
No related merge requests found
......@@ -139,19 +139,19 @@ func (c *RouterChain) loop() {
// copyRouters make a snapshot copy from RouterChain's router list.
func (c *RouterChain) copyRouters() []router.PriorityRouter {
c.mutex.RLock()
defer c.mutex.RUnlock()
ret := copySlice(c.routers)
c.mutex.RUnlock()
return ret.([]router.PriorityRouter)
}
// copyInvokers copies a snapshot of the received invokers.
func (c *RouterChain) copyInvokers() []protocol.Invoker {
c.mutex.RLock()
defer c.mutex.RUnlock()
if c.invokers == nil || len(c.invokers) == 0 {
return nil
}
ret := copySlice(c.invokers)
c.mutex.RUnlock()
return ret.([]protocol.Invoker)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment