Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-08-18 08:13:57 +0400
committerChristopher Faylor <me@cgf.cx>2002-08-18 08:13:57 +0400
commit0428827b0ef30a187a72fc0fc5352d7c0c170c82 (patch)
tree2656aed12a35fdd4ab8af643a82ad9a442934af0 /winsup/cygwin/exceptions.cc
parenta80add95d9e1598ff55e32801d1719a79146be8c (diff)
* 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.cc11
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);
}