* sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset to avoid

potential races.
(init_child_info): Avoid unneeded test.
This commit is contained in:
Christopher Faylor 2000-09-01 21:04:34 +00:00
parent 488c7683e3
commit 837528aa51
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Fri Sep 1 16:57:44 2000 Christopher Faylor <cgf@cygnus.com>
* sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset
to avoid potential races.
(init_child_info): Avoid unneeded test.
Fri Sep 1 16:51:26 2000 Christopher Faylor <cgf@cygnus.com>
* sigproc.cc (proc_info): Rename proc_exists which takes a pid to

View File

@ -610,7 +610,7 @@ sig_dispatch_pending (int justwake)
void __stdcall
sigproc_init ()
{
wait_sig_inited = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL);
wait_sig_inited = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
ProtectHandle (wait_sig_inited);
/* local event signaled when main thread has been dispatched
@ -914,7 +914,7 @@ init_child_info (DWORD chtype, child_info *ch, pid_t pid, HANDLE subproc_ready)
ch->subproc_ready = subproc_ready;
if (chtype != PROC_EXEC || !parent_alive)
ch->parent_alive = hwait_subproc;
else if (parent_alive)
else
DuplicateHandle (hMainProc, parent_alive, hMainProc, &ch->parent_alive,
0, 1, DUPLICATE_SAME_ACCESS);
}