Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: eb31e787d040876254b0a36ea42550f78c3fc817
Ticket: f4f44174e4c88a9132b19bcc4b68346a1d229fe1
protect notifier against signals
User & Date: aspect on 2016-12-05 23:04:39
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    The following script (using Tclx) eventually hangs, as the signal is
    delivered either to the notifier thread or to Tcl_AlertNotifier.
    
    Patch coming.
    
    ~~~
    package require Tclx
    package require Thread
    
    signal trap SIGHUP handler
    
    proc handler args {
        puts "SIGHUP [incr ::HUPS] in [thread::id] $args"
    }
    
    proc gotinput {chan} {
        gets $chan d
        puts "hupity $d"
    }
    
    set sub [thread::create thread::wait]
    
    lassign [chan pipe] r w
    chan configure $r -blocking 0
    chan event $r readable [list gotinput $r]
    
    thread::transfer $sub $w
    thread::send $sub [list set wchan $w]
    
    thread::send -async $sub {
        package require Tclx
        set pid [pid]
        while 1 {
            kill HUP $pid
            puts $wchan [incr ::HUP]
        }
    } result
    
    vwait result
    ~~~
    
  5. foundin changed to: "trunk"
  6. is_private changed to: "0"
  7. login: "aspect"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "cb02a4a25e8da92f2790bc307bf01ef24ce6053e"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "aspect"
  14. subsystem changed to: "01. Notifier"
  15. title changed to: "protect notifier against signals"
  16. type changed to: "Bug"