listen ctx for closing object

This commit is contained in:
Sergey Cherepanov 2023-02-13 21:49:56 +03:00
parent 4c00dba1cf
commit 18451bd4fe
No known key found for this signature in database
GPG Key ID: 87F8EDE8FBDF637C

View File

@ -176,8 +176,12 @@ Load:
} }
c.mu.Unlock() c.mu.Unlock()
if closing { if closing {
<-e.close select {
goto Load case <-ctx.Done():
return nil, ctx.Err()
case <-e.close:
goto Load
}
} }
if load { if load {