Commit 1106b7e2 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Move DiscardAll out of critical section.

parent ce46e694
......@@ -75,10 +75,10 @@ func DiscardAll(r io.Reader) {
}
func (me *pairPool) done(p *Pair) {
DiscardAll(p.r)
me.Lock()
defer me.Unlock()
DiscardAll(p.r)
me.usedCount--
me.unused = append(me.unused, p)
}
......
Markdown is supported
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