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

2022-07-25 Thread TheDiveO
Per, I fully agree for the case where you have full control over the code architecture ... in such a case the only way is to stop digging and getting out of the hole. Or have a party leadership contest instead ... just [j|ch]oking. In this particular situation I don't have control over the Go

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

2022-07-25 Thread p...@morth.org
Hi, I think you need to restructure your code, because what you're actually doing is checking whether the pid is valid or not. Since the pid is made invalid inside the Wait call (in the kernel), before ProcessState is set, there's no way to do that safely. Instead, you should avoid calling Wait