diff options
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 906dc6a35..c65e7bb37 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -553,7 +553,16 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) } VerifyHandle (sendsig); if (!communing) - CloseHandle (hp); + { + CloseHandle (hp); + DWORD flag = PIPE_NOWAIT; + /* Set PIPE_NOWAIT here to avoid blocking when sending a signal. + (Yes, I know MSDN says not to use this) + We can't ever block here because it causes a deadlock when + debugging with gdb. */ + BOOL res = SetNamedPipeHandleState (sendsig, &flag, NULL, NULL); + sigproc_printf ("%d = SetNamedPipeHandleState (%y, PIPE_NOWAIT, NULL, NULL)", res, sendsig); + } else { si._si_commune._si_process_handle = hp; |