* dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.
* exceptions.cc (exit_lock): Delete. (events_init): Don't init exit_lock. * (_pinfo::commune_process): Add per-PICOM debugging. * sigproc.cc (talktome): Add some temporary debugging statements. * fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change. (format_proc_partitions): Ditto. * syscalls.cc (locked_append): Ditto.
This commit is contained in:
parent
f5cfdc0fa4
commit
0cb6fc5d30
|
@ -1,3 +1,15 @@
|
||||||
|
2005-10-01 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.
|
||||||
|
* exceptions.cc (exit_lock): Delete.
|
||||||
|
(events_init): Don't init exit_lock.
|
||||||
|
* (_pinfo::commune_process): Add per-PICOM debugging.
|
||||||
|
* sigproc.cc (talktome): Add some temporary debugging statements.
|
||||||
|
|
||||||
|
* fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change.
|
||||||
|
(format_proc_partitions): Ditto.
|
||||||
|
* syscalls.cc (locked_append): Ditto.
|
||||||
|
|
||||||
2005-09-30 Christopher Faylor <cgf@timesys.com>
|
2005-09-30 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()
|
* dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()
|
||||||
|
|
|
@ -1141,8 +1141,7 @@ _exit (int n)
|
||||||
void
|
void
|
||||||
get_exit_lock ()
|
get_exit_lock ()
|
||||||
{
|
{
|
||||||
extern CRITICAL_SECTION exit_lock;
|
myself.lock ();
|
||||||
EnterCriticalSection (&exit_lock);
|
|
||||||
if (exit_state < ES_SET_MUTO)
|
if (exit_state < ES_SET_MUTO)
|
||||||
{
|
{
|
||||||
exit_state = ES_SET_MUTO;
|
exit_state = ES_SET_MUTO;
|
||||||
|
|
|
@ -1167,8 +1167,6 @@ exit_sig:
|
||||||
signal_exit (si.si_signo); /* never returns */
|
signal_exit (si.si_signo); /* never returns */
|
||||||
}
|
}
|
||||||
|
|
||||||
CRITICAL_SECTION NO_COPY exit_lock;
|
|
||||||
|
|
||||||
/* Cover function to `do_exit' to handle exiting even in presence of more
|
/* Cover function to `do_exit' to handle exiting even in presence of more
|
||||||
exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit
|
exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit
|
||||||
routines to run. */
|
routines to run. */
|
||||||
|
@ -1229,7 +1227,6 @@ events_init ()
|
||||||
windows_system_directory_length = end - windows_system_directory;
|
windows_system_directory_length = end - windows_system_directory;
|
||||||
debug_printf ("windows_system_directory '%s', windows_system_directory_length %d",
|
debug_printf ("windows_system_directory '%s', windows_system_directory_length %d",
|
||||||
windows_system_directory, windows_system_directory_length);
|
windows_system_directory, windows_system_directory_length);
|
||||||
InitializeCriticalSection (&exit_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -394,6 +394,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
{
|
{
|
||||||
case PICOM_CMDLINE:
|
case PICOM_CMDLINE:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_CMDLINE");
|
||||||
unsigned n = 1;
|
unsigned n = 1;
|
||||||
extern int __argc_safe;
|
extern int __argc_safe;
|
||||||
const char *argv[__argc_safe + 1];
|
const char *argv[__argc_safe + 1];
|
||||||
|
@ -428,6 +429,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_CWD:
|
case PICOM_CWD:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_CWD");
|
||||||
unsigned int n = strlen (cygheap->cwd.get (path, 1, 1,
|
unsigned int n = strlen (cygheap->cwd.get (path, 1, 1,
|
||||||
CYG_MAX_PATH)) + 1;
|
CYG_MAX_PATH)) + 1;
|
||||||
if (!WriteFile (tothem, &n, sizeof n, &nr, NULL))
|
if (!WriteFile (tothem, &n, sizeof n, &nr, NULL))
|
||||||
|
@ -438,6 +440,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_ROOT:
|
case PICOM_ROOT:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_ROOT");
|
||||||
unsigned n;
|
unsigned n;
|
||||||
if (cygheap->root.exists ())
|
if (cygheap->root.exists ())
|
||||||
n = strlen (strcpy (path, cygheap->root.posix_path ())) + 1;
|
n = strlen (strcpy (path, cygheap->root.posix_path ())) + 1;
|
||||||
|
@ -451,6 +454,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_FDS:
|
case PICOM_FDS:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_FDS");
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
int fd;
|
int fd;
|
||||||
cygheap_fdenum cfd;
|
cygheap_fdenum cfd;
|
||||||
|
@ -470,6 +474,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_PIPE_FHANDLER:
|
case PICOM_PIPE_FHANDLER:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_FDS");
|
||||||
HANDLE hdl = si._si_commune._si_pipe_fhandler;
|
HANDLE hdl = si._si_commune._si_pipe_fhandler;
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
cygheap_fdenum cfd;
|
cygheap_fdenum cfd;
|
||||||
|
@ -490,6 +495,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_FD:
|
case PICOM_FD:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_FD");
|
||||||
int fd = si._si_commune._si_fd;
|
int fd = si._si_commune._si_fd;
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
cygheap_fdget cfd (fd);
|
cygheap_fdget cfd (fd);
|
||||||
|
@ -505,6 +511,7 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
case PICOM_FIFO:
|
case PICOM_FIFO:
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("processing PICOM_FIFO");
|
||||||
fhandler_fifo *fh = cygheap->fdtab.find_fifo (si._si_commune._si_str);
|
fhandler_fifo *fh = cygheap->fdtab.find_fifo (si._si_commune._si_str);
|
||||||
HANDLE it[2];
|
HANDLE it[2];
|
||||||
if (fh == NULL)
|
if (fh == NULL)
|
||||||
|
@ -530,7 +537,11 @@ _pinfo::commune_process (siginfo_t& si)
|
||||||
}
|
}
|
||||||
if (process_sync)
|
if (process_sync)
|
||||||
{
|
{
|
||||||
WaitForSingleObject (process_sync, INFINITE);
|
DWORD res = WaitForSingleObject (process_sync, 5000);
|
||||||
|
if (res != WAIT_OBJECT_0)
|
||||||
|
sigproc_printf ("WFSO failed - %d, %E", res);
|
||||||
|
else
|
||||||
|
sigproc_printf ("synchronized with pid %d", si.si_pid);
|
||||||
ForceCloseHandle (process_sync);
|
ForceCloseHandle (process_sync);
|
||||||
}
|
}
|
||||||
CloseHandle (tothem);
|
CloseHandle (tothem);
|
||||||
|
@ -586,7 +597,11 @@ _pinfo::commune_request (__uint32_t code, ...)
|
||||||
|
|
||||||
si.si_signo = __SIGCOMMUNE;
|
si.si_signo = __SIGCOMMUNE;
|
||||||
if (sig_send (this, si))
|
if (sig_send (this, si))
|
||||||
|
{
|
||||||
|
ForceCloseHandle (request_sync); /* don't signal semaphore since there was apparently no receiving process */
|
||||||
|
request_sync = NULL;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
size_t n;
|
size_t n;
|
||||||
switch (code)
|
switch (code)
|
||||||
|
|
|
@ -970,7 +970,9 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
|
||||||
static void
|
static void
|
||||||
talktome (siginfo_t& si, HANDLE readsig)
|
talktome (siginfo_t& si, HANDLE readsig)
|
||||||
{
|
{
|
||||||
|
sigproc_printf ("pid %d wants some information", si.si_pid);
|
||||||
pinfo pi (si.si_pid);
|
pinfo pi (si.si_pid);
|
||||||
|
sigproc_printf ("pid %d pi %p", si.si_pid, (_pinfo *) pi); // DELETEME
|
||||||
if (si._si_commune._si_code & PICOM_EXTRASTR)
|
if (si._si_commune._si_code & PICOM_EXTRASTR)
|
||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
|
@ -1173,6 +1175,7 @@ wait_sig (VOID *)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseHandle (readsig);
|
||||||
sigproc_printf ("signal thread exiting");
|
sigproc_printf ("signal thread exiting");
|
||||||
ExitThread (0);
|
ExitThread (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue