Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fixes #1482, removed unsafe double RLock
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzyna-z committed Feb 17, 2017
1 parent 85079bc commit 20f15b2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions control/strategy/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,8 @@ func (p *pool) SubscriptionCount() int {
}

// SelectAP selects an available plugin from the pool
// the method is not thread safe, 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
Expand Down

0 comments on commit 20f15b2

Please sign in to comment.