summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-03-11 00:19:23 (GMT)
committerstanton <stanton>1999-03-11 00:19:23 (GMT)
commit959ef2397770f8b6b7319b28c4cee7ef60ba6ac4 (patch)
tree5395cacc9a5253542d062dfcb57426a2721a541b /win/tclWinInit.c
parent17d56fd5b956aa638c25faaac51a8856ee8f51d7 (diff)
downloadtcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.zip
tcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.tar.gz
tcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.tar.bz2
* win/tclWinPipe.c:
* generic/tclInt.decls: Added TclWinAddProcess to make it possible for expect to use Tcl_WaitForPid(). This patch is from Gordon Chaffee. * mac/tclMacPort.h: * win/tclWinInit.c: * unix/tclUnixPort.h: * generic/tclAsync.c: Added TclpAsyncMark to fix bug in async handling on Windows where async events don't wake up the event loop. This patch comes from Gordon Chaffee. * generic/tcl.decls: Fixed declarations of reserved slots.
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 6173def..2a470df 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinInit.c,v 1.12 1999/02/02 18:36:31 stanton Exp $
+ * RCS: @(#) $Id: tclWinInit.c,v 1.13 1999/03/11 00:19:24 stanton Exp $
*/
#include "tclInt.h"
@@ -82,6 +82,12 @@ static char* processors[NUMPROCESSORS] = {
#include "tclInitScript.h"
+/*
+ * Thread id used for asynchronous notification from signal handlers.
+ */
+
+static DWORD threadId;
+
/*
*----------------------------------------------------------------------
@@ -279,6 +285,13 @@ TclPlatformInit(interp)
}
Tcl_DStringFree(&ds);
+
+ /*
+ * Save the current thread id so an async signal handler can poke
+ * the right thread using TclpAyncMark.
+ */
+
+ threadId = GetCurrentThreadId();
}
/*
@@ -396,3 +409,31 @@ Tcl_SourceRCFile(interp)
Tcl_DStringFree(&temp);
}
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpAsyncMark --
+ *
+ * Wake up the main thread from a signal handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sends a message to the main thread.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclpAsyncMark(async)
+ Tcl_AsyncHandler async; /* Token for handler. */
+{
+ /*
+ * Need a way to kick the Windows event loop and tell it to go look at
+ * asynchronous events.
+ */
+
+ PostThreadMessage(threadId, WM_USER, 0, 0);
+}