diff options
author | sebres <sebres@users.sourceforge.net> | 2017-04-11 18:08:12 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-04-11 18:08:12 (GMT) |
commit | 119d9ad3aa713f76079c0aebb625fb861b09fa68 (patch) | |
tree | 1df007d39ed59d380f50b50f76215d62db937e32 /win/tclWinInit.c | |
parent | 8b0910d31f1affbd2ccefd74d2df1eeba7a1f736 (diff) | |
download | tcl-119d9ad3aa713f76079c0aebb625fb861b09fa68.zip tcl-119d9ad3aa713f76079c0aebb625fb861b09fa68.tar.gz tcl-119d9ad3aa713f76079c0aebb625fb861b09fa68.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.c | 20 |
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"); + } } /* |