diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-17 14:24:56 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-17 17:15:26 +0100 |
commit | 4b3ca38b2e8aa07f6fecbba0cc150b1fab9227e3 (patch) | |
tree | f8a29e5ffeee238602b7430bc2fe08c810cf37e7 /tpl | |
parent | 77cbe4d60bfa708cbf695ae5f2524d4f76007e71 (diff) |
tplimpl: Fix data race in resGetResource
Fixes #3045
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/template_resources.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/tplimpl/template_resources.go b/tpl/tplimpl/template_resources.go index 2b3d7120c..48a79d066 100644 --- a/tpl/tplimpl/template_resources.go +++ b/tpl/tplimpl/template_resources.go @@ -49,8 +49,8 @@ func (l *remoteLock) URLLock(url string) { if _, ok := l.m[url]; !ok { l.m[url] = &sync.Mutex{} } - l.Unlock() // call this Unlock before the next lock will be called. NFI why but defer doesn't work. l.m[url].Lock() + l.Unlock() } // URLUnlock unlocks an URL when the download has been finished. Use only in defer calls. |