If Queue::Shutdown()
sends nil
into q.shutdown
before the goroutine in Queue::Start()
creates the channel, the send will block indefinitely as q.shutdown
would still be a nil
channel.
Running the following a few times should reproduce the issue.
package main
import (
"context"
"git.sr.ht/~sircmpwn/dowork"
)
func main() {
task := work.NewTask(func(ctx context.Context) error {
return nil
})
work.Enqueue(task)
work.Shutdown()
}