From f613f9eed33b82c3d712a4679fa56e3192d9e283 Mon Sep 17 00:00:00 2001 From: davygrvy Date: Fri, 23 Apr 2004 07:12:08 +0000 Subject: * win/tclWinTime.c: If the Tcl_ExitProc (StopCalibration) is called from the stack frame of DllMain's PROCESS_DETACH, the wait operation should timeout and continue. --- win/tclWinTime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 931f906..2c10978 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.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: tclWinTime.c,v 1.24 2004/04/06 22:25:58 dgp Exp $ + * RCS: @(#) $Id: tclWinTime.c,v 1.25 2004/04/23 07:12:08 davygrvy Exp $ */ #include "tclInt.h" @@ -434,7 +434,11 @@ StopCalibration( ClientData unused ) /* Client data is unused */ { SetEvent( timeInfo.exitEvent ); - WaitForSingleObject( timeInfo.calibrationThread, INFINITE ); + /* + * If Tcl_Finalize was called from DllMain, the calibration thread + * is in a paused state so we need to timeout and continue. + */ + WaitForSingleObject( timeInfo.calibrationThread, 100 ); CloseHandle( timeInfo.exitEvent ); CloseHandle( timeInfo.calibrationThread ); } -- cgit v0.12