From 57f8f9cbc63d40cd252e0848b96c46f09ccf2642 Mon Sep 17 00:00:00 2001 From: katarzyna-z Date: Thu, 16 Feb 2017 15:05:42 +0100 Subject: [PATCH] Fixes #1482, removed unsafe double RLock --- control/strategy/pool.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/control/strategy/pool.go b/control/strategy/pool.go index 01174a41e..f99b0b7bc 100644 --- a/control/strategy/pool.go +++ b/control/strategy/pool.go @@ -361,10 +361,8 @@ func (p *pool) SubscriptionCount() int { } // SelectAP selects an available plugin from the pool +// the method is not thread safety, it should be protected outside of the body func (p *pool) SelectAP(taskID string, config map[string]ctypes.ConfigValue) (AvailablePlugin, serror.SnapError) { - p.RLock() - defer p.RUnlock() - aps := p.plugins.Values() var id string