Descriptionpresent: fix another race condition
Several bad things are posible.
1. Since c.run() is executed in a separate goroutine,
c.kill() can find c.cmd==nil. If so, it won't kill the process,
but will wait for it's completion. Deadlock.
2. c.kill() can "kill" already completed "go build" process,
but then wait for completion of the compiled binary. Deadlock once again.
With this change it's impossible to kill "go build" process,
but it must not hang, right?
Patch Set 1 #Patch Set 2 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #Patch Set 3 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #Patch Set 4 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #Patch Set 5 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #Patch Set 6 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #MessagesTotal messages: 2
|