patch1.diff

Masaki Matsushita, 09/23/2011 11:43 PM

Download (932 Bytes)

View differences:

lib/weakref.rb
28 28
  @@id_rev_map =  {}            # ref -> obj
29 29
  @@mutex = Mutex.new
30 30
  @@final = lambda {|id|
31
    @@mutex.synchronize {
32
      rids = @@id_map[id]
33
      if rids
34
        for rid in rids
35
          @@id_rev_map.delete(rid)
36
        end
37
        @@id_map.delete(id)
38
      end
39
      rid = @@id_rev_map[id]
40
      if rid
41
        @@id_rev_map.delete(id)
42
        @@id_map[rid].delete(id)
43
        @@id_map.delete(rid) if @@id_map[rid].empty?
31
    rids = @@id_map[id]
32
    if rids
33
      for rid in rids
34
        @@id_rev_map.delete(rid)
44 35
      end
45
    }
36
      @@id_map.delete(id)
37
    end
38
    rid = @@id_rev_map[id]
39
    if rid
40
      @@id_rev_map.delete(id)
41
      @@id_map[rid].delete(id)
42
      @@id_map.delete(rid) if @@id_map[rid].empty?
43
    end
46 44
  }
47 45

  
48 46
  ##