Tcl Source Code

Artifact [eeb3d7a729]
Login

Artifact eeb3d7a7299632433a789f9a988025add4432607:

Attachment "707174.patch" to ticket [707174ffff] added by dgp 2003-03-21 06:32:59.
? dblstub.patch
? 707174.patch
? unix/cat
? unix/test1
? unix/httpd_17857
? unix/longfile
? unix/test2
? unix/test3
? unix/rc
? unix/.tclUnixNotfy.c.swp
Index: generic/tclInt.h
===================================================================
RCS file: /home/cvs/cvsroot/sun/tcl/generic/tclInt.h,v
retrieving revision 1.1.1.24
diff -u -r1.1.1.24 tclInt.h
--- generic/tclInt.h	4 Mar 2003 20:43:36 -0000	1.1.1.24
+++ generic/tclInt.h	20 Mar 2003 23:03:41 -0000
@@ -1577,6 +1577,7 @@
 extern Tcl_ChannelType		tclFileChannelType;
 extern char *			tclMemDumpFileName;
 extern TclPlatformType		tclPlatform;
+extern Tcl_NotifierProcs	tclOriginalNotifier;
 
 /*
  * Variables denoting the Tcl object types defined in the core.
Index: generic/tclStubInit.c
===================================================================
RCS file: /home/cvs/cvsroot/sun/tcl/generic/tclStubInit.c,v
retrieving revision 1.1.1.20
diff -u -r1.1.1.20 tclStubInit.c
--- generic/tclStubInit.c	4 Mar 2003 20:43:34 -0000	1.1.1.20
+++ generic/tclStubInit.c	20 Mar 2003 23:03:42 -0000
@@ -37,6 +37,24 @@
 #endif
 
 /*
+ * Keep a record of the original Notifier procedures, created in the
+ * same compilation unit as the stub tables so we can later do reliable,
+ * portable comparisons to see whether a Tcl_SetNotifier() call swapped
+ * new routines into the stub table.
+ */
+
+Tcl_NotifierProcs tclOriginalNotifier = {
+    Tcl_SetTimer,
+    Tcl_WaitForEvent,
+    Tcl_CreateFileHandler,
+    Tcl_DeleteFileHandler,
+    Tcl_InitNotifier,
+    Tcl_FinalizeNotifier,
+    Tcl_AlertNotifier,
+    Tcl_ServiceModeHook
+};
+
+/*
  * WARNING: The contents of this file is automatically generated by the
  * tools/genStubs.tcl script. Any modifications to the function declarations
  * below should be made in the generic/tcl.decls script.
Index: mac/tclMacNotify.c
===================================================================
RCS file: /home/cvs/cvsroot/sun/tcl/mac/tclMacNotify.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 tclMacNotify.c
--- mac/tclMacNotify.c	6 Mar 2002 17:02:03 -0000	1.1.1.11
+++ mac/tclMacNotify.c	20 Mar 2003 23:03:42 -0000
@@ -48,6 +48,7 @@
  */
  
 extern TclStubs tclStubs;
+extern Tcl_NotifierProcs tclOriginalNotifier;
 
 /*
  * The follwing static indicates whether this module has been initialized.
@@ -339,7 +340,7 @@
      * on the Mac, but mirrors the UNIX hook.
      */
 
-    if (tclStubs.tcl_SetTimer != Tcl_SetTimer) {
+    if (tclStubs.tcl_SetTimer != tclOriginalNotifier.setTimerProc) {
 	tclStubs.tcl_SetTimer(timePtr);
 	return;
     }
@@ -420,7 +421,7 @@
      * sense on the Mac, but mirrors the UNIX hook.
      */
 
-    if (tclStubs.tcl_WaitForEvent != Tcl_WaitForEvent) {
+    if (tclStubs.tcl_WaitForEvent != tclOriginalNotifier.waitForEventProc) {
 	return tclStubs.tcl_WaitForEvent(timePtr);
     }
 
Index: unix/tclUnixNotfy.c
===================================================================
RCS file: /home/cvs/cvsroot/sun/tcl/unix/tclUnixNotfy.c,v
retrieving revision 1.1.1.15
diff -u -r1.1.1.15 tclUnixNotfy.c
--- unix/tclUnixNotfy.c	11 Sep 2002 14:09:50 -0000	1.1.1.15
+++ unix/tclUnixNotfy.c	20 Mar 2003 23:03:42 -0000
@@ -19,6 +19,7 @@
 #include <signal.h> 
 
 extern TclStubs tclStubs;
+extern Tcl_NotifierProcs tclOriginalNotifier;
 
 /*
  * This structure is used to keep track of the notifier info for a 
@@ -353,7 +354,7 @@
      * timeout values to Tcl_WaitForEvent.
      */
 
-    if (tclStubs.tcl_SetTimer != Tcl_SetTimer) {
+    if (tclStubs.tcl_SetTimer != tclOriginalNotifier.setTimerProc) {
 	tclStubs.tcl_SetTimer(timePtr);
     }
 }
@@ -412,7 +413,7 @@
     FileHandler *filePtr;
     int index, bit;
 
-    if (tclStubs.tcl_CreateFileHandler != Tcl_CreateFileHandler) {
+    if (tclStubs.tcl_CreateFileHandler != tclOriginalNotifier.createFileHandlerProc) {
 	tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData);
 	return;
     }
@@ -486,7 +487,7 @@
     unsigned long flags;
     ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
 
-    if (tclStubs.tcl_DeleteFileHandler != Tcl_DeleteFileHandler) {
+    if (tclStubs.tcl_DeleteFileHandler != tclOriginalNotifier.deleteFileHandlerProc) {
 	tclStubs.tcl_DeleteFileHandler(fd);
 	return;
     }
@@ -662,7 +663,7 @@
 #endif
     ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
 
-    if (tclStubs.tcl_WaitForEvent != Tcl_WaitForEvent) {
+    if (tclStubs.tcl_WaitForEvent != tclOriginalNotifier.waitForEventProc) {
 	return tclStubs.tcl_WaitForEvent(timePtr);
     }
 
Index: win/tclWinNotify.c
===================================================================
RCS file: /home/cvs/cvsroot/sun/tcl/win/tclWinNotify.c,v
retrieving revision 1.1.1.13
diff -u -r1.1.1.13 tclWinNotify.c
--- win/tclWinNotify.c	4 Mar 2003 20:43:51 -0000	1.1.1.13
+++ win/tclWinNotify.c	20 Mar 2003 23:03:42 -0000
@@ -45,6 +45,8 @@
 static Tcl_ThreadDataKey dataKey;
 
 extern TclStubs tclStubs;
+extern Tcl_NotifierProcs tclOriginalNotifier;
+
 /*
  * The following static indicates the number of threads that have
  * initialized notifiers.  It controls the lifetime of the TclNotifier
@@ -267,7 +269,7 @@
      * on Windows, but mirrors the UNIX hook.
      */
 
-    if (tclStubs.tcl_SetTimer != Tcl_SetTimer) {
+    if (tclStubs.tcl_SetTimer != tclOriginalNotifier.setTimerProc) {
 	tclStubs.tcl_SetTimer(timePtr);
 	return;
     }
@@ -433,7 +435,7 @@
      * sense on windows, but mirrors the UNIX hook.
      */
 
-    if (tclStubs.tcl_WaitForEvent != Tcl_WaitForEvent) {
+    if (tclStubs.tcl_WaitForEvent != tclOriginalNotifier.waitForEventProc) {
 	return tclStubs.tcl_WaitForEvent(timePtr);
     }