* dll_init.h (class dll_list): Reorder functions to avoid compiler "can't
inline" warnings. * security.h (class cygsid): Ditto. * sigproc.cc (get_proc_lock): Ditto. * sigproc.h (class sigframe): Ditto. * sync.h (class muto): Ditto. * fhandler.h (fhandler_base::get_guard): Actually MAKE virtual as previously indicated. * pipe.cc (make_pipe): Remove extraneous set_errno. * syscalls.cc (_open): Ditto. * select.cc (peek_pipe): Need to check that there is still something to read from the pipe after acquiring the mutex since another process/thread could have eaten the input before we got to acquiring the lock. (Thanks to Nick Duffek for this inspiration.)
This commit is contained in:
@ -179,6 +179,29 @@ wait_for_me ()
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the sync_proc_subproc muto to control access to
|
||||
* children, zombie arrays.
|
||||
* Attempt to handle case where process is exiting as we try to grab
|
||||
* the mutex.
|
||||
*/
|
||||
static BOOL
|
||||
get_proc_lock (DWORD what, DWORD val)
|
||||
{
|
||||
Static int lastwhat = -1;
|
||||
if (!sync_proc_subproc)
|
||||
return FALSE;
|
||||
if (sync_proc_subproc->acquire (WPSP))
|
||||
{
|
||||
lastwhat = what;
|
||||
return TRUE;
|
||||
}
|
||||
if (!sync_proc_subproc)
|
||||
return FALSE;
|
||||
system_printf ("Couldn't aquire sync_proc_subproc for(%d,%d), %E, last %d",
|
||||
what, val, lastwhat);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL __stdcall
|
||||
proc_can_be_signalled (_pinfo *p)
|
||||
{
|
||||
@ -939,29 +962,6 @@ getsem (_pinfo *p, const char *str, int init, int max)
|
||||
return h;
|
||||
}
|
||||
|
||||
/* Get the sync_proc_subproc muto to control access to
|
||||
* children, zombie arrays.
|
||||
* Attempt to handle case where process is exiting as we try to grab
|
||||
* the mutex.
|
||||
*/
|
||||
static BOOL
|
||||
get_proc_lock (DWORD what, DWORD val)
|
||||
{
|
||||
Static int lastwhat = -1;
|
||||
if (!sync_proc_subproc)
|
||||
return FALSE;
|
||||
if (sync_proc_subproc->acquire (WPSP))
|
||||
{
|
||||
lastwhat = what;
|
||||
return TRUE;
|
||||
}
|
||||
if (!sync_proc_subproc)
|
||||
return FALSE;
|
||||
system_printf ("Couldn't aquire sync_proc_subproc for(%d,%d), %E, last %d",
|
||||
what, val, lastwhat);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Remove a zombie from zombies by swapping it with the last child in the list.
|
||||
*/
|
||||
static void __stdcall
|
||||
|
Reference in New Issue
Block a user