trap("SIGINT") aborts too early when sleep is called
----------------------------------------------------

                 Key: JRUBY-6045
                 URL: https://jira.codehaus.org/browse/JRUBY-6045
             Project: JRuby
          Issue Type: Bug
         Environment: OSX 1.6.8, Windows 7 32bit
            Reporter: Xavier Shay
            Assignee: Thomas E Enebo


The following script does not output the second puts "2":

$stopping = false
trap("SIGINT") {
  $stopping = true
  puts "1"
  # The call to sleep prevents the following `puts`
  sleep 1
  puts "2"
  exit
}

puts "started"
while true && !$stopping
  puts "Spewing %s" % rand
  sleep 0.2
  puts "Did something"
end

For history, see this thread: 
http://old.nabble.com/Trapping-SIGNINT-to32410432.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to