[MacRuby] #873: ThreadGroup can't freeze.

MacRuby ruby-noreply at macosforge.org
Mon Aug 23 07:57:33 PDT 2010


#873: ThreadGroup can't freeze.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  minor                 |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 $ cat test_freeze.rb
 def assert_raise(a, &block)
   begin
     block.call
   rescue => e
     p e.class == a
   else
     p :ng
   end
   puts "-----"
 end

 thgrp = ThreadGroup.new

 t = Thread.new{1}
 Thread.new{
   thgrp.add(Thread.current)
   thgrp.freeze
   assert_raise(ThreadError) do
     Thread.new{1}.join
   end
   assert_raise(ThreadError) do
     thgrp.add(t)
   end
   assert_raise(ThreadError) do
     ThreadGroup.new.add Thread.current
   end
 }.join
 t.join
 }}}

 Result of Ruby 1.9.1:
 {{{
 $ ruby test_freeze.rb
 true
 -----
 true
 -----
 true
 -----
 }}}

 Result of MacRuby Trunk:
 {{{
 $ macruby test_freeze.rb
 :ng
 -----
 :ng
 -----
 :ng
 -----
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/873>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list