[MacRuby] #874: Abort occurs when calls Thread#raise / #kill when Thread#join is called in block of Thread.

MacRuby ruby-noreply at macosforge.org
Sun Nov 13 19:35:24 PST 2011


#874: Abort occurs when calls Thread#raise / #kill when Thread#join is called in
block of Thread.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:  MacRuby 1.0          
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------

Comment(by lastobelus@…):

 this also causes a crash:


 {{{
 t = Thread.new { STDIN.read(1) }
 t.kill

 }}}

 however, for reading multibyte characters correctly a workaround is to
 take advantage of the fact that STDIN.read behaves differently on macruby
 than on standard ruby, sending an EOF after each character.  So:

 {{{
 STDIN.read(3)
 }}}

 will return immediately for a single key press but will capture all 3
 characters of control keys

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/874#comment:3>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list