diff options
author | sebres <sebres@users.sourceforge.net> | 2017-04-05 19:52:23 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-04-05 19:52:23 (GMT) |
commit | 9bb9d59d856e33313c1f34ec3eb2ac1e0bc145c5 (patch) | |
tree | b7f09e8cc0487921bd391309b69ba533825b0277 /win/tclWinSerial.c | |
parent | 21c607d91ac4d1bd5fbe8820ec592293970c347f (diff) | |
download | tcl-9bb9d59d856e33313c1f34ec3eb2ac1e0bc145c5.zip tcl-9bb9d59d856e33313c1f34ec3eb2ac1e0bc145c5.tar.gz tcl-9bb9d59d856e33313c1f34ec3eb2ac1e0bc145c5.tar.bz2 |
the same handling to initialize thread without suspend/resume helpers (otherwise may be dangerous by very huge resp. too busy system);
Diffstat (limited to 'win/tclWinSerial.c')
-rw-r--r-- | win/tclWinSerial.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index fa135ab..f55f5f1 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1339,8 +1339,7 @@ SerialWriterThread( /* * Notify TclWinOpenSerialChannel() that this thread is initialized */ - SetEvent(infoPtr->evStartWriter); - SuspendThread(infoPtr->writeThread); /* until main thread get an event */ + SignalObjectAndWait(infoPtr->evStartWriter, infoPtr->evStopWriter, INFINITE, FALSE); /* * The stop event takes precedence by being first in the list. @@ -1565,7 +1564,8 @@ TclWinOpenSerialChannel( infoPtr, 0, &id); /* Wait for thread to initialize (using evStartWriter) */ WaitForSingleObject(infoPtr->evStartWriter, 5000); - ResumeThread(infoPtr->writeThread); + /* Wake-up it to signal we've get an event */ + SetEvent(infoPtr->evStopWriter); } /* |