Tcl Source Code

Check-in [9a396c910e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[Bug 3547994]: Abandon the synchronous Windows pipe driver to its fate when needed to honour TIP#398.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a396c910eaaeda376617765029c9b1101350a19
User & Date: ferrieux 2012-07-25 09:57:03
Context
2012-07-25
14:47
3546275 Make [auto_execok] search match [exec]. Thanks Koen Danckaert. check-in: 6909864f56 user: dgp tags: trunk
09:57
[Bug 3547994]: Abandon the synchronous Windows pipe driver to its fate when needed to honour TIP#398... check-in: 9a396c910e user: ferrieux tags: trunk
08:10
sync with TEA, fix some comments check-in: 0728cce9c7 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-07-23  Alexandre Ferrieux  <[email protected]>

	* generic/tclIO.c: [Bug  3545365]: Never try a bg-flush  on a dead
	channel, just like before 2011-08-17.

2012-07-19  Joe Mistachkin  <[email protected]>

>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-07-25  Alexandre Ferrieux  <[email protected]>

	* win/tclWinPipe.c: [Bug 3547994]: Abandon the synchronous Windows
	pipe driver to its fate when needed to honour TIP#398.

2012-07-23  Alexandre Ferrieux  <[email protected]>

	* generic/tclIO.c: [Bug  3545365]: Never try a bg-flush  on a dead
	channel, just like before 2011-08-17.

2012-07-19  Joe Mistachkin  <[email protected]>

Changes to win/tclWinPipe.c.

1871
1872
1873
1874
1875
1876
1877
1878
1879
1880

1881


1882









1883


1884
1885
1886
1887
1888
1889
1890
	pipePtr->validMask &= ~TCL_READABLE;
	pipePtr->readFile = NULL;
    }
    if ((!flags || flags & TCL_CLOSE_WRITE)
	    && (pipePtr->writeFile != NULL)) {
	if (pipePtr->writeThread) {
	    /*
	     * Wait for the writer thread to finish the current buffer, then
	     * terminate the thread and close the handles. If the channel is
	     * nonblocking, there should be no pending write operations.

	     */












	    WaitForSingleObject(pipePtr->writable, INFINITE);



	    /*
	     * The thread may already have closed on it's own. Check its exit
	     * code.
	     */

	    GetExitCodeThread(pipePtr->writeThread, &exitCode);







|
|
|
>

>
>

>
>
>
>
>
>
>
>
>
|
>
>







1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
	pipePtr->validMask &= ~TCL_READABLE;
	pipePtr->readFile = NULL;
    }
    if ((!flags || flags & TCL_CLOSE_WRITE)
	    && (pipePtr->writeFile != NULL)) {
	if (pipePtr->writeThread) {
	    /*
	     * Wait for the  writer thread to finish the  current buffer, then
	     * terminate the thread  and close the handles. If  the channel is
	     * nonblocking but blocked during  exit, bail out since the worker
	     * thread is not interruptible and we want TIP#398-fast-exit.
	     */
	    if (TclInExit()
		&& (pipePtr->flags & PIPE_ASYNC)) {

		/* give it a chance to leave honorably */
		SetEvent(pipePtr->stopWriter);

		if (WaitForSingleObject(pipePtr->writable, 0) == WAIT_TIMEOUT) {
		    return EAGAIN;
		}

	    } else {

		WaitForSingleObject(pipePtr->writable, INFINITE);

	    }

	    /*
	     * The thread may already have closed on it's own. Check its exit
	     * code.
	     */

	    GetExitCodeThread(pipePtr->writeThread, &exitCode);
2940
2941
2942
2943
2944
2945
2946




2947
2948
2949
2950
2951
2952
2953
	waitResult = WaitForMultipleObjects(2, wEvents, FALSE, INFINITE);

	if (waitResult != (WAIT_OBJECT_0 + 1)) {
	    /*
	     * The start event was not signaled. It might be the stop event or
	     * an error, so exit.
	     */





	    break;
	}

	buf = infoPtr->writeBuf;
	toWrite = infoPtr->toWrite;








>
>
>
>







2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
	waitResult = WaitForMultipleObjects(2, wEvents, FALSE, INFINITE);

	if (waitResult != (WAIT_OBJECT_0 + 1)) {
	    /*
	     * The start event was not signaled. It might be the stop event or
	     * an error, so exit.
	     */

	    if (waitResult == WAIT_OBJECT_0) {
		SetEvent(infoPtr->writable);
	    }

	    break;
	}

	buf = infoPtr->writeBuf;
	toWrite = infoPtr->toWrite;