read-only lock for check of shutdown

This commit is contained in:
Seebs 2021-12-17 22:25:01 -06:00
parent 9a2a8f964c
commit 1439c316d3

View file

@ -146,8 +146,8 @@ func newExecutor(opts ...executorOption) *executor {
for running {
<-periodic.C
func() {
e.workMu.Lock()
defer e.workMu.Unlock()
e.workMu.RLock()
defer e.workMu.RUnlock()
if e.shutdown {
running = false
return