listen ctx for closing object

This commit is contained in:
Sergey Cherepanov 2023-02-13 21:49:56 +03:00 committed by Mikhail Iudin
parent 703bf4fda6
commit f858d39534
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0

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 {