Re: [go-nuts] How to check Cmd.ProcessState without triggering the race checker?

2022-07-26 Thread TheDiveO
Hi Steven, correct, I only noticed this later but in the end I decided to not make use of it. The reason is that there still is no atomicity and no locking, so the Cmd.Process can do whatever it want, especially playing the Blue Norwegian. On Tuesday, July 26, 2022 at 1:28:45 AM UTC+2 Steven

Re: [go-nuts] How to check Cmd.ProcessState without triggering the race checker?

2022-07-25 Thread Steven Hartland
Looks like session already has what you need as you can check if session.Exited has been closed something like: select { case <- session.Exited: // Handle session has ended default: // Handle session hasn't ended } On Sat, 23 Jul 2022 at 21:39, TheDiveO wrote: > In my open source

Re: [go-nuts] How to check Cmd.ProcessState without triggering the race checker?

2022-07-24 Thread Ian Lance Taylor
On Sat, Jul 23, 2022 at 1:39 PM TheDiveO wrote: > > In my open source file descriptor leak checker (Linux only) for Gomega, Go's > race detector flags a race condition in my code where I need to check whether > a Cmd.Process already has terminated as its ProcessState has been set. > > if

[go-nuts] How to check Cmd.ProcessState without triggering the race checker?

2022-07-23 Thread TheDiveO
In my open source file descriptor leak checker (Linux only) for Gomega, Go's race detector flags a race condition in my code where I need to check whether a Cmd.Process already has terminated