summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
Diffstat (limited to 'static_pool.go')
-rw-r--r--static_pool.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/static_pool.go b/static_pool.go
index 19fc1d13..80847f6e 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -273,10 +273,9 @@ func (p *StaticPool) destroying() bool {
// throw invokes event handler if any.
func (p *StaticPool) throw(event int, ctx interface{}) {
p.mul.Lock()
- lsn := p.lsn
- p.mul.Unlock()
+ defer p.mul.Unlock()
- if lsn != nil {
- lsn(event, ctx)
+ if p.lsn != nil {
+ p.lsn(event, ctx)
}
}