diff options
author | Christopher Faylor <me@cgf.cx> | 2002-08-18 04:13:57 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-08-18 04:13:57 +0000 |
commit | 0428827b0ef30a187a72fc0fc5352d7c0c170c82 (patch) | |
tree | 2656aed12a35fdd4ab8af643a82ad9a442934af0 /winsup/cygwin/exceptions.cc | |
parent | a80add95d9e1598ff55e32801d1719a79146be8c (diff) | |
download | cygnal-0428827b0ef30a187a72fc0fc5352d7c0c170c82.tar.gz cygnal-0428827b0ef30a187a72fc0fc5352d7c0c170c82.tar.bz2 cygnal-0428827b0ef30a187a72fc0fc5352d7c0c170c82.zip |
* sigproc.cc (sigCONT): Define.
* sigproc.h (sigCONT): Declare.
(wait_sig): Create sigCONT event here.
* exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather than
stopping thread.
(sig_handle): Set sigCONT event as appropriate on SIGCONT rather than calling
ResumeThread.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 914e4424d..cadd6baaf 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -615,7 +615,9 @@ sig_handle_tty_stop (int sig) } sigproc_printf ("process %d stopped by signal %d, myself->ppid_handle %p", myself->pid, sig, myself->ppid_handle); - SuspendThread (hMainThread); + if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0) + api_fatal ("WaitSingleObject failed, %E"); + (void) ResetEvent (sigCONT); return; } } @@ -992,6 +994,7 @@ sig_handle (int sig, bool thisproc) /* FIXME: Should we still do this if SIGCONT has a handler? */ if (sig == SIGCONT) { + DWORD stopped = myself->process_state & PID_STOPPED; myself->stopsig = 0; myself->process_state &= ~PID_STOPPED; /* Clear pending stop signals */ @@ -999,10 +1002,8 @@ sig_handle (int sig, bool thisproc) sig_clear (SIGTSTP); sig_clear (SIGTTIN); sig_clear (SIGTTOU); - /* Windows 95 hangs on resuming non-suspended thread */ - SuspendThread (hMainThread); - while (ResumeThread (hMainThread) > 1) - ; + if (stopped) + SetEvent (sigCONT); /* process pending signals */ sig_dispatch_pending (1); } |