This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: snapshot 20050114 race (on list)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]