summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sigproc.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-08-11 19:19:29 +0000
committerChristopher Faylor <me@cgf.cx>2002-08-11 19:19:29 +0000
commit3cb62bd614c2960567f8b6ea643427daa39e8650 (patch)
treecad4777be13b616c13d5e4b9c7321d73339fdb61 /winsup/cygwin/sigproc.cc
parent2324fd5b91a7e9a50b3e2f494f02a7204720df9f (diff)
downloadcygnal-3cb62bd614c2960567f8b6ea643427daa39e8650.tar.gz
cygnal-3cb62bd614c2960567f8b6ea643427daa39e8650.tar.bz2
cygnal-3cb62bd614c2960567f8b6ea643427daa39e8650.zip
* assert.cc (__assert): Call debugger on assertion failure if debugging.
* dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather than going through the overhead of invoking it. * fork.cc (fork_child): Ditto. * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here. * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is live. (sig_dispatch): Ditto. (sig_send): Ditto. (wait_for_sigthread): Renamed from "wait_for_me". Assume that wait_sig_inited has been set and that this function is only called from the main thread. * winsup.h (wait_for_sigthread): Declare new function.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 4914e6a24..49c8bda57 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -17,6 +17,7 @@ details. */
#include <errno.h>
#include <stdlib.h>
#include <sys/cygwin.h>
+#include <assert.h>
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
@@ -167,19 +168,13 @@ out:
return res;
}
-__inline static void
-wait_for_me ()
+void __stdcall
+wait_for_sigthread ()
{
- /* See if this is the first signal call after initialization.
- * If so, wait for notification that all initialization has completed.
- * Then set the handle to NULL to avoid checking this again.
- */
- if (wait_sig_inited)
- {
- (void) WaitForSingleObject (wait_sig_inited, INFINITE);
- (void) ForceCloseHandle (wait_sig_inited);
- wait_sig_inited = NULL;
- }
+ assert (wait_sig_inited);
+ (void) WaitForSingleObject (wait_sig_inited, INFINITE);
+ (void) ForceCloseHandle (wait_sig_inited);
+ wait_sig_inited = NULL;
}
/* Get the sync_proc_subproc muto to control access to
@@ -210,7 +205,7 @@ proc_can_be_signalled (_pinfo *p)
{
if (p == myself_nowait || p == myself_nowait_nonmain || p == myself)
{
- wait_for_me ();
+ assert (!wait_sig_inited);
return 1;
}
@@ -535,7 +530,7 @@ sig_dispatch_pending (int justwake)
#endif
else
{
- wait_for_me ();
+ assert (!wait_sig_inited);
if (!justwake)
(void) sig_send (myself, __SIGFLUSH);
else if (ReleaseSemaphore (sigcatch_nosync, 1, NULL))
@@ -657,7 +652,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp, bool exception)
{
if (no_signals_available ())
goto out; // Either exiting or not yet initializing
- wait_for_me ();
+ assert (!wait_sig_inited);
wait_for_completion = p != myself_nowait;
p = myself;
}