summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-03-11 01:50:26 (GMT)
committerstanton <stanton>1999-03-11 01:50:26 (GMT)
commitda3b0b4ffd7c69cd67f9a48ef39bfec6fd7fa3dd (patch)
treefd4ffd5b672a390d34c3ddbf56a53ecfb2dc89d2 /win/tclWinPipe.c
parent0ad8a310e8ae892d27c4981cfd0ea148e0d7984c (diff)
downloadtcl-da3b0b4ffd7c69cd67f9a48ef39bfec6fd7fa3dd.zip
tcl-da3b0b4ffd7c69cd67f9a48ef39bfec6fd7fa3dd.tar.gz
tcl-da3b0b4ffd7c69cd67f9a48ef39bfec6fd7fa3dd.tar.bz2
* generic/tcl.h:
* generic/tcl.decls: Changed Tcl_ReleaseType from an enum to macros so it can be used in .rc files. Added Tcl_GetString. * mac/tclMacNotify.c: * generic/tclNotify.c: * generic/tclInt.h: * win/tclWinNotify.c: * generic/tcl.h: Renamed Tcl_AlertNotifier to TclpAlertNotifier. * 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/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c50
1 files changed, 35 insertions, 15 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index b48ba80..b64c343 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.1.2.6 1999/02/26 02:19:24 redman Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.1.2.7 1999/03/11 01:50:34 stanton Exp $
*/
#include "tclWinInt.h"
@@ -1144,13 +1144,7 @@ TclpCreateProcess(
}
*pidPtr = (Tcl_Pid) procInfo.hProcess;
if (*pidPtr != 0) {
- ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
- procPtr->hProcess = procInfo.hProcess;
- procPtr->dwProcessId = procInfo.dwProcessId;
- Tcl_MutexLock(&procMutex);
- procPtr->nextPtr = procList;
- procList = procPtr;
- Tcl_MutexUnlock(&procMutex);
+ TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
result = TCL_OK;
}
@@ -1457,13 +1451,7 @@ TclpCreateProcess(
*pidPtr = (Tcl_Pid) procInfo.hProcess;
if (*pidPtr != 0) {
- ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
- procPtr->hProcess = procInfo.hProcess;
- procPtr->dwProcessId = procInfo.dwProcessId;
- Tcl_MutexLock(&procMutex);
- procPtr->nextPtr = procList;
- procList = procPtr;
- Tcl_MutexUnlock(&procMutex);
+ TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
result = TCL_OK;
@@ -2765,6 +2753,38 @@ Tcl_WaitPid(
/*
*----------------------------------------------------------------------
*
+ * TclWinAddProcess --
+ *
+ * Add a process to the process list so that we can use
+ * Tcl_WaitPid on the process.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Adds the specified process handle to the process list so
+ * Tcl_WaitPid knows about it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclWinAddProcess(hProcess, id)
+ HANDLE hProcess; /* Handle to process */
+ DWORD id; /* Global process identifier */
+{
+ ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
+ procPtr->hProcess = hProcess;
+ procPtr->dwProcessId = id;
+ Tcl_MutexLock(&procMutex);
+ procPtr->nextPtr = procList;
+ procList = procPtr;
+ Tcl_MutexUnlock(&procMutex);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tcl_PidObjCmd --
*
* This procedure is invoked to process the "pid" Tcl command.