Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c68462dbc9ec046da6407edf0ee66f025ce74432
Ticket: 67a5eabbd3d195915d3ccc13246bdecf10e20726
refchan, coroutine, and postevent from the "watch" proc
User & Date: pooryorick on 2016-08-15 10:31:45
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    The following script results in an error to the effect that the coroutine is
    already running.
    
    <code><verbatim>
    #! /bin/env tclsh
    
    interp bgerror {} [list apply {{res opts} {
        puts stderr [dict get $opts -errorinfo]
        exit 1
    }}]
    
    namespace eval schan {
        namespace ensemble create
        namespace export *
        proc open {} {
            variable chans
            set chan [chan create read [namespace current]]
    
        }
        proc initialize {chan mode} {
            return [list initialize finalize read watch]
        }
    
        proc read {chan count} {
        }
    
        proc watch {chan eventspec} {
            chan postevent $chan $eventspec
        }
    }
    
    coroutine c1 apply [list {} {
        set chan [schan::open]
        chan event $chan readable [list [info coroutine]]
        yield
        puts thiswillnotappear
    }] 
    vwait ::forever
    </verbatim></code>
    
  5. foundin changed to: "8.6.6"
  6. is_private changed to: "0"
  7. login: "pooryorick"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "e476148cded301ffff84bcdc432536dc0c949e88"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "pooryorick"
  14. subsystem changed to: "60. NRE and coroutines"
  15. title changed to:
    refchan, coroutine, and postevent from the "watch" proc
    
  16. type changed to: "Bug"