diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-28 08:00:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-28 08:00:51 (GMT) |
commit | e5766f95f8b74aa6577cf8dff98d48a71ab9d131 (patch) | |
tree | 6e85f7dd2b98f0c060086540c153617c8b70ae9d /win | |
parent | 69d1bdb95ef90f112d06b7ece0d6db57c504a030 (diff) | |
parent | 2836feb5d8fbaffcd6371c423cd0a0b0eebac840 (diff) | |
download | tcl-e5766f95f8b74aa6577cf8dff98d48a71ab9d131.zip tcl-e5766f95f8b74aa6577cf8dff98d48a71ab9d131.tar.gz tcl-e5766f95f8b74aa6577cf8dff98d48a71ab9d131.tar.bz2 |
merge core-8-6-branchfix_1997007
Diffstat (limited to 'win')
-rwxr-xr-x | win/configure | 3 | ||||
-rw-r--r-- | win/configure.in | 1 | ||||
-rw-r--r-- | win/makefile.vc | 1 | ||||
-rw-r--r-- | win/tclConfig.sh.in | 3 | ||||
-rw-r--r-- | win/tclWinConsole.c | 6 | ||||
-rw-r--r-- | win/tclWinInit.c | 2 | ||||
-rw-r--r-- | win/tclWinInt.h | 10 | ||||
-rw-r--r-- | win/tclWinPipe.c | 22 | ||||
-rw-r--r-- | win/tclWinSerial.c | 2 |
9 files changed, 27 insertions, 23 deletions
diff --git a/win/configure b/win/configure index e8e4b87..85dc0ba 100755 --- a/win/configure +++ b/win/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING ZLIB_DLL_FILE ZLIB_LIBS ZLIB_OBJS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_WIN_VERSION MACHINE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL PKG_CFG_ARGS TCL_EXE TCL_LIB_FILE TCL_LIB_FLAG TCL_STATIC_LIB_FILE TCL_STATIC_LIB_FLAG TCL_IMPORT_LIB_FILE TCL_IMPORT_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_DLL_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_DBGX CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TCL_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB MAKE_STUB_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TCL_BUILD_LIB_SPEC TCL_LD_SEARCH_FLAGS TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_PACKAGE_PATH TCL_DDE_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_MINOR_VERSION TCL_REG_VERSION TCL_REG_MAJOR_VERSION TCL_REG_MINOR_VERSION RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING ZLIB_DLL_FILE ZLIB_LIBS ZLIB_OBJS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_WIN_VERSION MACHINE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL PKG_CFG_ARGS TCL_EXE TCL_LIB_FILE TCL_LIB_FLAG TCL_STATIC_LIB_FILE TCL_STATIC_LIB_FLAG TCL_IMPORT_LIB_FILE TCL_IMPORT_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_DLL_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_DBGX CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TCL_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB MAKE_STUB_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TCL_BUILD_LIB_SPEC TCL_CC_SEARCH_FLAGS TCL_LD_SEARCH_FLAGS TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_PACKAGE_PATH TCL_DDE_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_MINOR_VERSION TCL_REG_VERSION TCL_REG_MAJOR_VERSION TCL_REG_MINOR_VERSION RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -6010,6 +6010,7 @@ s,@POST_MAKE_LIB@,$POST_MAKE_LIB,;t t s,@MAKE_DLL@,$MAKE_DLL,;t t s,@MAKE_EXE@,$MAKE_EXE,;t t s,@TCL_BUILD_LIB_SPEC@,$TCL_BUILD_LIB_SPEC,;t t +s,@TCL_CC_SEARCH_FLAGS@,$TCL_CC_SEARCH_FLAGS,;t t s,@TCL_LD_SEARCH_FLAGS@,$TCL_LD_SEARCH_FLAGS,;t t s,@TCL_NEEDS_EXP_FILE@,$TCL_NEEDS_EXP_FILE,;t t s,@TCL_BUILD_EXP_FILE@,$TCL_BUILD_EXP_FILE,;t t diff --git a/win/configure.in b/win/configure.in index 8bb9c48..b478d1e 100644 --- a/win/configure.in +++ b/win/configure.in @@ -433,6 +433,7 @@ AC_SUBST(MAKE_EXE) # empty on win, but needs sub'ing AC_SUBST(TCL_BUILD_LIB_SPEC) +AC_SUBST(TCL_CC_SEARCH_FLAGS) AC_SUBST(TCL_LD_SEARCH_FLAGS) AC_SUBST(TCL_NEEDS_EXP_FILE) AC_SUBST(TCL_BUILD_EXP_FILE) diff --git a/win/makefile.vc b/win/makefile.vc index 8cbae2e..ada08cc 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -878,6 +878,7 @@ $(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in @SHLIB_SUFFIX@ .dll
@DL_LIBS@
@LDFLAGS@
+@TCL_CC_SEARCH_FLAGS@
@TCL_LD_SEARCH_FLAGS@
@LIBOBJS@
@RANLIB@
diff --git a/win/tclConfig.sh.in b/win/tclConfig.sh.in index 75324b2..6ed06e2 100644 --- a/win/tclConfig.sh.in +++ b/win/tclConfig.sh.in @@ -92,10 +92,11 @@ TCL_DL_LIBS='@DL_LIBS@' # an executable tclsh or tcltest binary. TCL_LD_FLAGS='@LDFLAGS@' -# Flags to pass to ld, such as "-R /usr/local/tcl/lib", that tell the +# Flags to pass to cc/ld, such as "-R /usr/local/tcl/lib", that tell the # run-time dynamic linker where to look for shared libraries such as # libtcl.so. Used when linking applications. Only works if there # is a variable "LIB_RUNTIME_DIR" defined in the Makefile. +TCL_CC_SEARCH_FLAGS='@TCL_CC_SEARCH_FLAGS@' TCL_LD_SEARCH_FLAGS='@TCL_LD_SEARCH_FLAGS@' # Additional object files linked with Tcl to provide compatibility diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 7a0965d..d61a030 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1106,7 +1106,7 @@ ConsoleReaderThread( HANDLE *handle = NULL; ConsoleThreadInfo *threadInfo = NULL; int done = 0; - + while (!done) { /* * Wait for the main thread to signal before attempting to read. @@ -1205,7 +1205,7 @@ ConsoleWriterThread( DWORD count, toWrite; char *buf; int done = 0; - + while (!done) { /* * Wait for the main thread to signal before attempting to write. @@ -1339,7 +1339,7 @@ TclWinOpenConsoleChannel( infoPtr->reader.readyEvent = CreateEvent(NULL, TRUE, TRUE, NULL); infoPtr->reader.thread = CreateThread(NULL, 256, ConsoleReaderThread, - TclPipeThreadCreateTI(&infoPtr->reader.TI, infoPtr, + TclPipeThreadCreateTI(&infoPtr->reader.TI, infoPtr, infoPtr->reader.readyEvent), 0, NULL); SetThreadPriority(infoPtr->reader.thread, THREAD_PRIORITY_HIGHEST); } diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 03ef5df..f13e314 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -166,7 +166,7 @@ TclpInitPlatform(void) */ hInstance = LoadLibraryW(L"kernel32"); if (hInstance != NULL) { - _tclWinProcs.cancelSynchronousIo = + _tclWinProcs.cancelSynchronousIo = (BOOL (WINAPI *)(HANDLE)) GetProcAddress(hInstance, "CancelSynchronousIo"); } diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 86945a9..76f5f68 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -98,14 +98,14 @@ MODULE_SCOPE void TclpSetAllocCache(void *); /* *---------------------------------------------------------------------- * Declarations of helper-workers threaded facilities for a pipe based channel. - * + * * Corresponding functionality provided in "tclWinPipe.c". *---------------------------------------------------------------------- */ typedef struct TclPipeThreadInfo { HANDLE evControl; /* Auto-reset event used by the main thread to - * signal when the pipe thread should attempt + * signal when the pipe thread should attempt * to do read/write operation. Additionally * used as signal to stop (state set to -1) */ volatile LONG state; /* Indicates current state of the thread */ @@ -122,7 +122,7 @@ typedef struct TclPipeThreadInfo { /* * State of the pipe-worker. - * + * * State PTI_STATE_STOP possible from idle state only, worker owns TI structure. * Otherwise PTI_STATE_END used (main thread hold ownership of the TI). */ @@ -134,8 +134,8 @@ typedef struct TclPipeThreadInfo { #define PTI_STATE_DOWN 8 /* worker is down */ -MODULE_SCOPE -TclPipeThreadInfo * TclPipeThreadCreateTI(TclPipeThreadInfo **pipeTIPtr, +MODULE_SCOPE +TclPipeThreadInfo * TclPipeThreadCreateTI(TclPipeThreadInfo **pipeTIPtr, ClientData clientData, HANDLE wakeEvent); MODULE_SCOPE int TclPipeThreadWaitForSignal(TclPipeThreadInfo **pipeTIPtr); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index d303f8f..4a1e75a 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -2619,7 +2619,7 @@ WaitForRead( */ /* avoid blocking if pipe-thread exited */ - timeout = (!blocking || !TclPipeThreadIsAlive(&infoPtr->readTI) + timeout = (!blocking || !TclPipeThreadIsAlive(&infoPtr->readTI) || TclInExit() || TclInThreadExit()) ? 0 : INFINITE; if (WaitForSingleObject(infoPtr->readable, timeout) == WAIT_TIMEOUT) { /* @@ -2727,7 +2727,7 @@ PipeReaderThread( HANDLE handle = NULL; DWORD count, err; int done = 0; - + while (!done) { /* * Wait for the main thread to signal before attempting to wait on the @@ -3154,7 +3154,7 @@ TclPipeThreadWaitForSignal( } /* signaled to work */ - return 1; + return 1; end: /* end of work, check the owner of the TI structure */ @@ -3211,7 +3211,7 @@ TclPipeThreadStopSignal( *pipeTIPtr = NULL; case PTI_STATE_DOWN: - + return 1; default: @@ -3308,7 +3308,7 @@ TclPipeThreadStop( if (pipeTI && hThread) { DWORD exitCode; - + /* * The thread may already have closed on its own. Check its exit * code. @@ -3362,22 +3362,22 @@ TclPipeThreadStop( * As a result, all new threads are deadlocked in their initialization phase and never execute, * even though CreateThread() reports successful thread creation. * This results in a very weird process-wide behavior, which is extremely hard to debug. - * + * * THREADS SHOULD NEVER BE TERMINATED. Period. - * + * * But for now, check if thread is exiting, and if so, let it die peacefully. * * Also don't terminate if in exit (otherwise deadlocked in ntdll.dll's). */ if ( pipeTI->state != PTI_STATE_DOWN - && WaitForSingleObject(hThread, - inExit ? 50 : 5000) != WAIT_OBJECT_0 + && WaitForSingleObject(hThread, + inExit ? 50 : 5000) != WAIT_OBJECT_0 ) { /* BUG: this leaks memory */ if (inExit || !TerminateThread(hThread, 0)) { /* in exit or terminate fails, just give thread a chance to exit */ - if (InterlockedExchange(&pipeTI->state, + if (InterlockedExchange(&pipeTI->state, PTI_STATE_STOP) != PTI_STATE_DOWN) { pipeTI = NULL; } @@ -3408,7 +3408,7 @@ TclPipeThreadStop( * * Clean-up for the pipe thread (removes owned TI-structure in worker). * - * Should be executed on worker exit, to inform the main thread or + * Should be executed on worker exit, to inform the main thread or * free TI-structure (if owned). * * After calling of this function, TI-structure pointer given via pipeTIPtr diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index f78aa5a..fe416ff 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1470,7 +1470,7 @@ TclWinOpenSerialChannel( infoPtr->osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); infoPtr->evWritable = CreateEvent(NULL, TRUE, TRUE, NULL); infoPtr->writeThread = CreateThread(NULL, 256, SerialWriterThread, - TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr, + TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr, infoPtr->evWritable), 0, NULL); } |