diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-05 08:29:52 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-05 08:29:52 +0000 |
commit | 48653d5ef0ed47469d64170d70c8c2a9f21f159e (patch) | |
tree | df86f2bf64022459acef5eea33442fb3d3ebcc27 /lib/monitor.rb | |
parent | f5ac36f1a3e484464d13a115bd92fa9904215201 (diff) | |
download | bundler-48653d5ef0ed47469d64170d70c8c2a9f21f159e.tar.gz |
* lib/ostruct.rb: a patch from Florian Gross <florgro@gmail.com>
merged to allow recursive inspect (and to_s) for OpenStruct.
[ruby-core:05532]
* lib/observer.rb: a patch from nornagon <nornagon@gmail.com>
merged to allow arbitrary names for update methods.
[ruby-core:05416]
* eval.c (rb_f_fcall): new method to avoid inefficiency of
obj.instance_eval{send(...)} tricks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/monitor.rb')
-rw-r--r-- | lib/monitor.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/monitor.rb b/lib/monitor.rb index 6bd14d0789..c1ce7815ea 100644 --- a/lib/monitor.rb +++ b/lib/monitor.rb @@ -87,11 +87,11 @@ module MonitorMixin class Timeout < Exception; end def wait(timeout = nil) - @monitor.instance_eval {mon_check_owner()} + @monitor.fcall(:mon_check_owner) timer = create_timer(timeout) Thread.critical = true - count = @monitor.instance_eval {mon_exit_for_cond()} + count = @monitor.fcall(: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.instance_eval {mon_enter_for_cond(count)} + @monitor.fcall(:mon_enter_for_cond, count) Thread.critical = false end end @@ -125,7 +125,7 @@ module MonitorMixin end def signal - @monitor.instance_eval {mon_check_owner()} + @monitor.fcall(:mon_check_owner) Thread.critical = true t = @waiters.shift t.wakeup if t @@ -134,7 +134,7 @@ module MonitorMixin end def broadcast - @monitor.instance_eval {mon_check_owner()} + @monitor.fcall(: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.instance_eval {mon_initialize()} + obj.fcall(:mon_initialize) end # |