summaryrefslogtreecommitdiff
path: root/lib/monitor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/monitor.rb')
-rw-r--r--lib/monitor.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/monitor.rb b/lib/monitor.rb
index a573af2..6bd14d0 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -87,11 +87,11 @@ module MonitorMixin
class Timeout < Exception; end
def wait(timeout = nil)
- @monitor.__send__(:mon_check_owner)
+ @monitor.instance_eval {mon_check_owner()}
timer = create_timer(timeout)
Thread.critical = true
- count = @monitor.__send__(:mon_exit_for_cond)
+ count = @monitor.instance_eval {mon_exit_for_cond()}
@waiters.push(Thread.current)
begin
@@ -107,7 +107,7 @@ module MonitorMixin
if @waiters.include?(Thread.current) # interrupted?
@waiters.delete(Thread.current)
end
- @monitor.__send__(:mon_enter_for_cond, count)
+ @monitor.instance_eval {mon_enter_for_cond(count)}
Thread.critical = false
end
end
@@ -125,7 +125,7 @@ module MonitorMixin
end
def signal
- @monitor.__send__(:mon_check_owner)
+ @monitor.instance_eval {mon_check_owner()}
Thread.critical = true
t = @waiters.shift
t.wakeup if t
@@ -134,7 +134,7 @@ module MonitorMixin
end
def broadcast
- @monitor.__send__(:mon_check_owner)
+ @monitor.instance_eval {mon_check_owner()}
Thread.critical = true
for t in @waiters
t.wakeup
@@ -172,7 +172,7 @@ module MonitorMixin
def self.extend_object(obj)
super(obj)
- obj.__send__(:mon_initialize)
+ obj.instance_eval {mon_initialize()}
end
#