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

« back to all changes in this revision

Viewing changes to lib/monitor.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
    class Timeout < Exception; end
88
88
    
89
89
    def wait(timeout = nil)
90
 
      @monitor.fcall(:mon_check_owner)
 
90
      @monitor.funcall(:mon_check_owner)
91
91
      timer = create_timer(timeout)
92
92
      
93
93
      Thread.critical = true
94
 
      count = @monitor.fcall(:mon_exit_for_cond)
 
94
      count = @monitor.funcall(:mon_exit_for_cond)
95
95
      @waiters.push(Thread.current)
96
96
 
97
97
      begin
107
107
        if @waiters.include?(Thread.current)  # interrupted?
108
108
          @waiters.delete(Thread.current)
109
109
        end
110
 
        @monitor.fcall(:mon_enter_for_cond, count)
 
110
        @monitor.funcall(:mon_enter_for_cond, count)
111
111
        Thread.critical = false
112
112
      end
113
113
    end
125
125
    end
126
126
    
127
127
    def signal
128
 
      @monitor.fcall(:mon_check_owner)
 
128
      @monitor.funcall(:mon_check_owner)
129
129
      Thread.critical = true
130
130
      t = @waiters.shift
131
131
      t.wakeup if t
134
134
    end
135
135
    
136
136
    def broadcast
137
 
      @monitor.fcall(:mon_check_owner)
 
137
      @monitor.funcall(:mon_check_owner)
138
138
      Thread.critical = true
139
139
      for t in @waiters
140
140
        t.wakeup
172
172
  
173
173
  def self.extend_object(obj)
174
174
    super(obj)
175
 
    obj.fcall(:mon_initialize)
 
175
    obj.funcall(:mon_initialize)
176
176
  end
177
177
  
178
178
  #