Tcl Source Code

Check-in [b345c44424]
Login

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

Overview
Comment:merge trunk
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dgp-trunk-read
Files: files | file ages | folders
SHA1:b345c44424067c498f7b4a7d8e943be895d8c54b
User & Date: dgp 2014-05-08 16:12:35
Context
2014-05-08
16:21
merge trunk Closed-Leaf check-in: 30ae8cb927 user: dgp tags: dgp-trunk-read
16:12
merge trunk check-in: b345c44424 user: dgp tags: dgp-trunk-read
16:03
Fix the panic in iogt-2.5. Back in 2011, Bugs 3384654 and 3393276 first noticed troubles with Channe... check-in: cc5f6a9f05 user: dgp tags: trunk
03:28
merge trunk check-in: 41b555c6c8 user: dgp tags: dgp-trunk-read
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIO.c.

2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
....
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
}

static void
PreserveChannelBuffer(
    ChannelBuffer *bufPtr)
{
    if (bufPtr->refCount == 0) {
	Tcl_Panic("Reuse of ChannelBuffer!");
    }
    bufPtr->refCount++;
}

static void
ReleaseChannelBuffer(
    ChannelBuffer *bufPtr)
................................................................................
	    DiscardOutputQueued(statePtr);
	    ReleaseChannelBuffer(bufPtr);
	    continue;
	} else {
	    wroteSome = 1;
	}

	if (!IsBufferEmpty(bufPtr)) {
	    bufPtr->nextRemoved += written;
	}

	/*
	 * If this buffer is now empty, recycle it.
	 */

	if (IsBufferEmpty(bufPtr)) {
	    statePtr->outQueueHead = bufPtr->nextPtr;
	    if (statePtr->outQueueHead == NULL) {
		statePtr->outQueueTail = NULL;
	    }
	    RecycleBuffer(statePtr, bufPtr, 0);
	    bufPtr = NULL;
	}
	if (bufPtr) {
	    ReleaseChannelBuffer(bufPtr);
	}
    }	/* Closes "while (1)". */

    /*
     * If we wrote some data while flushing in the background, we are done.
     * We can't finish the background flush until we run out of data and the
     * channel becomes writable again. This ensures that all of the pending
     * data has been flushed at the system level.







|







 







<
|
<











<

<
|
<







2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
....
2699
2700
2701
2702
2703
2704
2705

2706

2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717

2718

2719

2720
2721
2722
2723
2724
2725
2726
}

static void
PreserveChannelBuffer(
    ChannelBuffer *bufPtr)
{
    if (bufPtr->refCount == 0) {
	Tcl_Panic("Reuse of ChannelBuffer! %p", bufPtr);
    }
    bufPtr->refCount++;
}

static void
ReleaseChannelBuffer(
    ChannelBuffer *bufPtr)
................................................................................
	    DiscardOutputQueued(statePtr);
	    ReleaseChannelBuffer(bufPtr);
	    continue;
	} else {
	    wroteSome = 1;
	}


	bufPtr->nextRemoved += written;


	/*
	 * If this buffer is now empty, recycle it.
	 */

	if (IsBufferEmpty(bufPtr)) {
	    statePtr->outQueueHead = bufPtr->nextPtr;
	    if (statePtr->outQueueHead == NULL) {
		statePtr->outQueueTail = NULL;
	    }
	    RecycleBuffer(statePtr, bufPtr, 0);

	}

	ReleaseChannelBuffer(bufPtr);

    }	/* Closes "while (1)". */

    /*
     * If we wrote some data while flushing in the background, we are done.
     * We can't finish the background flush until we run out of data and the
     * channel becomes writable again. This ensures that all of the pending
     * data has been flushed at the system level.