projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc61d3b
)
tpl: Fix deadlock in cached partials
author
Cameron Moore
<moorereason@gmail.com>
Tue, 17 Jan 2017 18:51:24 +0000
(12:51 -0600)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Wed, 18 Jan 2017 09:30:22 +0000
(10:30 +0100)
Cached partials that contained cached partials would create a deadlock.
Fixes #2935
tpl/template_funcs.go
patch
|
blob
|
history
diff --git
a/tpl/template_funcs.go
b/tpl/template_funcs.go
index 6c8a9957ee422ff5cdcc5149292c55247ba075fc..8f653808b52bde82f0b4788be69bb23ca4260e0b 100644
(file)
--- a/
tpl/template_funcs.go
+++ b/
tpl/template_funcs.go
@@
-1541,7
+1541,10
@@
func (tf *templateFuncster) Get(key, name string, context interface{}) (p templa
tf.cachedPartials.Lock()
if p, ok = tf.cachedPartials.p[key]; !ok {
+ tf.cachedPartials.Unlock()
p = tf.t.partial(name, context)
+
+ tf.cachedPartials.Lock()
tf.cachedPartials.p[key] = p
}
tf.cachedPartials.Unlock()