Change _function() to function() throughout.
* cygwin.din: Remove last vestiges (?) of newlib wrappers. * cygthread.cc (cygthread::detach): Always wait for event or suffer an apparently inavoidable race. * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been relocated. * debub.cc (lock_debug): Don't acquire lock on exit. * fork.cc (fork_child): Recreate mmaps before doing anything else since Windows has a habit of using blocks of memory in the child that could previously have been occupied by shared memory in the parent. * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here and provide some details about what went wrong. (fixup_mmaps_after_fork): Remove error message. * shared.cc (open_shared): Move warning message so that more detail is possible. * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a race. (sigproc_terminate): Specifically wait for process thread to terminate.
This commit is contained in:
@@ -472,6 +472,7 @@ proc_terminate (void)
|
||||
ForceCloseHandle1 (zombies[i]->hProcess, childhProc);
|
||||
ForceCloseHandle1 (zombies[i]->pid_handle, pid_handle);
|
||||
}
|
||||
zombies[i]->ppid = 1;
|
||||
zombies[i]->process_state = PID_EXITED; /* CGF FIXME - still needed? */
|
||||
zombies[i].release (); // FIXME: this breaks older gccs for some reason
|
||||
}
|
||||
@@ -561,6 +562,11 @@ sigproc_init ()
|
||||
wait_sig_inited = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
|
||||
ProtectHandle (wait_sig_inited);
|
||||
|
||||
/* sync_proc_subproc is used by proc_subproc. It serialises
|
||||
* access to the children and zombie arrays.
|
||||
*/
|
||||
new_muto (sync_proc_subproc);
|
||||
|
||||
/* local event signaled when main thread has been dispatched
|
||||
to a signal handler function. */
|
||||
signal_arrived = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
|
||||
@@ -569,11 +575,6 @@ sigproc_init ()
|
||||
hwait_sig = new cygthread (wait_sig, cygself, "sig");
|
||||
hwait_sig->zap_h ();
|
||||
|
||||
/* sync_proc_subproc is used by proc_subproc. It serialises
|
||||
* access to the children and zombie arrays.
|
||||
*/
|
||||
new_muto (sync_proc_subproc);
|
||||
|
||||
/* Initialize waitq structure for main thread. A waitq structure is
|
||||
* allocated for each thread that executes a wait to allow multiple threads
|
||||
* to perform waits. Pre-allocate a waitq structure for the main thread.
|
||||
@@ -598,6 +599,16 @@ sigproc_terminate (void)
|
||||
{
|
||||
hwait_sig = NULL;
|
||||
|
||||
if (!sig_loop_wait)
|
||||
sigproc_printf ("sigproc_terminate: sigproc handling not active");
|
||||
else
|
||||
{
|
||||
sigproc_printf ("entering");
|
||||
sig_loop_wait = 0; // Tell wait_sig to exit when it is
|
||||
// finished with anything it is doing
|
||||
sig_dispatch_pending (1);
|
||||
}
|
||||
|
||||
if (GetCurrentThreadId () == sigtid)
|
||||
{
|
||||
ForceCloseHandle (sigcomplete_main);
|
||||
@@ -610,22 +621,6 @@ sigproc_terminate (void)
|
||||
}
|
||||
proc_terminate (); // Terminate process handling thread
|
||||
|
||||
if (!sig_loop_wait)
|
||||
sigproc_printf ("sigproc_terminate: sigproc handling not active");
|
||||
else
|
||||
{
|
||||
sigproc_printf ("entering");
|
||||
sig_loop_wait = 0; // Tell wait_sig to exit when it is
|
||||
// finished with anything it is doing
|
||||
sigproc_printf ("done");
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Set this so that subsequent tests will succeed. */
|
||||
if (!myself->dwProcessId)
|
||||
myself->dwProcessId = GetCurrentProcessId ();
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user