~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/weakref.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  @@id_rev_map =  {}            # ref -> obj
22
22
  @@mutex = Mutex.new
23
23
  @@final = lambda {|id|
24
 
    printf "final: %p\n", id
25
24
    @@mutex.synchronize {
26
25
      rids = @@id_map[id]
27
26
      if rids
41
40
 
42
41
  def initialize(orig)
43
42
    @__id = orig.object_id
44
 
    printf "orig: %p\n", @__id
45
43
    ObjectSpace.define_finalizer orig, @@final
46
44
    ObjectSpace.define_finalizer self, @@final
47
45
    @@mutex.synchronize {