[MacRuby] #542: Attempt to unlock a mutex which is not locked (ThreadError)

MacRuby ruby-noreply at macosforge.org
Mon Jun 13 06:50:41 PDT 2011


#542: Attempt to unlock a mutex which is not locked (ThreadError)
-------------------------------------+--------------------------------------
 Reporter:  valerii.hiora@…          |       Owner:  lsansonetti@…        
     Type:  defect                   |      Status:  new                  
 Priority:  major                    |   Milestone:  MacRuby 1.0          
Component:  MacRuby                  |    Keywords:                       
-------------------------------------+--------------------------------------

Comment(by watson1978@…):

 I guess that your changing is correct.
 the following script did not work before applying your changing in my
 environment.

 {{{
 #!ruby
 require 'thread'
 m = Mutex.new
 r = 0
 max = 100
 (1..max).map{
   Thread.new{
     i=0
     while i<max
       i+=1
       m.synchronize{
         r += 1
       }
     end
   }
 }.each{|e|
   e.join
 }

 puts :finish
 }}}

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



More information about the macruby-tickets mailing list