snapshot 20050114 race (on list)
Pierre A. Humblet
pierre.humblet@ieee.org
Wed Jan 19 15:30:00 GMT 2005
A similar issue of Cygwin vs. Windows process
termination time occurs when proc_waiter calls
maybe_set_exit_code_from_windows().
GetExitCodeProcess might well return STILL_ACTIVE.
It's unsafe to poll until that value changes,
so there should be a WaitFor(hProcess).
No further WaitFor is necessary when calling
set_exit_code when exiting after a spawn.
So, I think the code would be clearer by reverting
to having separate calls to GetExitCodeProcess
in proc_waiter and in child_info::sync.
child_info::sync can return either the exit
code or EXITCODE_NOSET, and spawn can then pass
that value to exit, avoiding further calls in
exit and clearing myself.hProcess in spawn.
Pierre
More information about the Cygwin-developers
mailing list