Cancel io if task is deleted without being started
This prevent a deadlock on Windows since no process is actually running until `Start()` is called. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
8e12d1fcad
commit
3df07cbc88
1
task.go
1
task.go
@ -188,6 +188,7 @@ func (t *task) Wait(ctx context.Context) (uint32, error) {
|
|||||||
// during cleanup
|
// during cleanup
|
||||||
func (t *task) Delete(ctx context.Context) (uint32, error) {
|
func (t *task) Delete(ctx context.Context) (uint32, error) {
|
||||||
if t.io != nil {
|
if t.io != nil {
|
||||||
|
t.io.Cancel()
|
||||||
t.io.Wait()
|
t.io.Wait()
|
||||||
t.io.Close()
|
t.io.Close()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user