summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-04-11 18:08:12 (GMT)
committersebres <sebres@users.sourceforge.net>2017-04-11 18:08:12 (GMT)
commitd99c5f05d972536e1110de39d62d9d167524f6a2 (patch)
tree1df007d39ed59d380f50b50f76215d62db937e32 /win/tclWinInit.c
parent9cdb43f156b83ecc400935cb6f424ceb55f30e75 (diff)
downloadtcl-d99c5f05d972536e1110de39d62d9d167524f6a2.zip
tcl-d99c5f05d972536e1110de39d62d9d167524f6a2.tar.gz
tcl-d99c5f05d972536e1110de39d62d9d167524f6a2.tar.bz2
shared structures of pipe-workers rewritten using atomic state of the thread;
asynchronous start/stop of pipe-workers (if possible), try the soft way to end workers using cancelSynchronousIo before it would be terminated;
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 8b600f6..03ef5df 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -76,6 +76,15 @@ typedef struct {
#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
#endif
+
+/*
+ * Windows version dependend functions
+ */
+static TclWinProcs _tclWinProcs = {
+ NULL
+};
+TclWinProcs *tclWinProcs = &_tclWinProcs;
+
/*
* The following arrays contain the human readable strings for the Windows
* platform and processor values.
@@ -132,6 +141,7 @@ TclpInitPlatform(void)
{
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD(2, 2);
+ HINSTANCE hInstance;
tclPlatform = TCL_PLATFORM_WINDOWS;
@@ -150,6 +160,16 @@ TclpInitPlatform(void)
TclWinInit(GetModuleHandle(NULL));
#endif
+
+ /*
+ * Fill available functions depending on windows version
+ */
+ hInstance = LoadLibraryW(L"kernel32");
+ if (hInstance != NULL) {
+ _tclWinProcs.cancelSynchronousIo =
+ (BOOL (WINAPI *)(HANDLE)) GetProcAddress(hInstance,
+ "CancelSynchronousIo");
+ }
}
/*