summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sigproc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 9c3b200b6..30318a7e1 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -401,7 +401,7 @@ proc_subproc (DWORD what, DWORD val)
{
wval->ev = wval->thread_ev = CreateEvent (&sec_none_nih, TRUE,
FALSE, NULL);
- ProtectHandle (wval->ev);
+ ProtectHandle1 (wval->ev, wq_ev);
}
ResetEvent (wval->ev);
@@ -469,6 +469,21 @@ out1:
return rc;
}
+// FIXME: This is inelegant
+void
+_cygtls::remove_wq ()
+{
+ sync_proc_subproc->acquire ();
+ for (waitq *w = &waitq_head; w->next != NULL; w = w->next)
+ if (w->next == &wq)
+ {
+ ForceCloseHandle1 (wq.thread_ev, wq_ev);
+ w->next = wq.next;
+ break;
+ }
+ sync_proc_subproc->release ();
+}
+
/* Terminate the wait_subproc thread.
* Called on process exit.
* Also called by spawn_guts to disassociate any subprocesses from this