diff options
author | hobbs <hobbs> | 2002-10-15 19:38:20 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-10-15 19:38:20 (GMT) |
commit | 7ce7df8818b8e218e96915671a763afc308e83d6 (patch) | |
tree | b3a134d7175b5749e20d5373d77ada4b0a36fa09 | |
parent | a6e53f06538d7c1043c7a81c99f57bb33388aa62 (diff) | |
download | tcl-7ce7df8818b8e218e96915671a763afc308e83d6.zip tcl-7ce7df8818b8e218e96915671a763afc308e83d6.tar.gz tcl-7ce7df8818b8e218e96915671a763afc308e83d6.tar.bz2 |
* win/tclWinThrd.c: removed unnecessary dos.h include.
Use problematic CreateThread/ExitThread for compilers that can't
do _beginthreadex/_endthreadex.
-rw-r--r-- | win/tclWinThrd.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index f76adf2..6c100f1 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -9,12 +9,11 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinThrd.c,v 1.8.2.1 2001/09/01 22:53:45 davygrvy Exp $ + * RCS: @(#) $Id: tclWinThrd.c,v 1.8.2.2 2002/10/15 19:38:20 hobbs Exp $ */ #include "tclWinInt.h" -#include <dos.h> #include <fcntl.h> #include <io.h> #include <sys/stat.h> @@ -125,8 +124,14 @@ Tcl_CreateThread(idPtr, proc, clientData, stackSize, flags) { HANDLE tHandle; +#if defined(__MSVCRT__) || defined(__BORLANDC__) tHandle = (HANDLE) _beginthreadex(NULL, (unsigned) stackSize, proc, clientData, 0, (unsigned *)idPtr); +#else + tHandle = CreateThread(NULL, (DWORD) stackSize, + (LPTHREAD_START_ROUTINE) proc, (LPVOID) clientData, + (DWORD) 0, (LPDWORD)idPtr); +#endif if (tHandle == NULL) { return TCL_ERROR; @@ -160,7 +165,11 @@ void TclpThreadExit(status) int status; { - _endthreadex((DWORD)status); +#if defined(__MSVCRT__) || defined(__BORLANDC__) + _endthreadex((unsigned) status); +#else + ExitThread((DWORD) status); +#endif } |