Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6462752f234bea7efd47385e9145fc9da0aba5a4
Ticket: 403432ffffffffffffffffffffffffffffffffff
Fix for Bug 118203
User & Date: dgp on 2001-01-27 00:50:56
Changes

  1. icomment:
    The change from outChan to inChan is a fix unrelated to
    Bug 118203.  I'm happy to move it to a separate patch if it
    delays acceptance of this patch.
    
    In generic/tclIO.c (Revision 1.27), compare lines 7058-7065
    to lines 7089-7096.  It looks to me like those sections are
    intended to change which channel, inChan or outChan, the
    copy operation is waiting on.  In lines 7058-7065, we know
    that inChan is not ready, so if we're already waiting on
    inChan (mask & TCL_READABLE), do nothing.  If we're not
    waiting on inChan, then check if we're waiting on outChan
    (mask & TCL_WRITABLE).  If so, cancel that wait, and start
    waiting on inChan, so when we exit the loop we're waiting
    only on inChan.
    
    To perform the analogous operation in lines 7089-7096, the
    change included in this patch is necessary.  Then the logic
    is that when outChan is not ready and we're not already
    waiting for it, cancel any wait for inChan, and start
    waiting for outChan.
    
    My assumption is that the copy operation wants to be waiting
    on only one of the channels at a time.  The fix implements
    that assumption.  As currently written, the copy operation
    can be waiting on both channels at the same time, and
    CopyData() may be called many times by an uncancelled
    readable fileevent when it can't do anything useful because
    outChan is still not ready. 
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"