Changeset 4168


Ignore:
Timestamp:
Feb 4, 2014 1:17:38 PM (7 years ago)
Author:
ldelgass
Message:

VisViewer::SendBytes? is not re-entrant safe: it will clobber the output buffer.
Since we don't have an output queue, try just blocking on writes to the socket
instead of using tkwait (which can cause us to re-enter SendBytes? if an event
like a Configure/resize comes in while we are waiting).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/visviewer.tcl

    r4108 r4168  
    453453    set _done($this) 1
    454454    set _buffer(out) $bytes
    455     fileevent $_sid writable [itcl::code $this SendHelper]
    456     tkwait variable ::Rappture::VisViewer::_done($this)
     455    if {1} {
     456        # Let's try this approach: allow a write to block so we don't
     457        # re-enter SendBytes
     458        SendHelper
     459    } else {
     460        # This can cause us to re-enter SendBytes during the tkwait, which
     461        # is not safe because the _buffer will be clobbered
     462        fileevent $_sid writable [itcl::code $this SendHelper]
     463        tkwait variable ::Rappture::VisViewer::_done($this)
     464    }
    457465    set _buffer(out) ""
    458466    if { [IsConnected] } {
Note: See TracChangeset for help on using the changeset viewer.