Fixed data race for hooks with ttls

issue #497
This commit is contained in:
tidwall 2019-10-08 09:25:50 -07:00
parent 5abadd72a3
commit 13c206fe05

View File

@ -41,9 +41,10 @@ func (list *List) bg() {
}
if now > list.queue.peek().unix { // now.After(list.queue.peek().unix)
n := list.queue.pop()
exfn := list.Expired
list.mu.Unlock()
if list.Expired != nil {
list.Expired(n.item)
if exfn != nil {
exfn(n.item)
}
} else {
list.mu.Unlock()