diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-02 14:53:02 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-02 14:53:02 +0000 |
| commit | 4d5513d4697170120a2068e18263d416d5cd9d8b (patch) | |
| tree | 6d1723d76ff18cb42093f13789963dbac3214a16 /lib/monitor.rb | |
| parent | 778687ab738e00eb1ca0c5630fc4c727adf3fdb5 (diff) | |
| download | ruby-4d5513d4697170120a2068e18263d416d5cd9d8b.tar.gz ruby-4d5513d4697170120a2068e18263d416d5cd9d8b.tar.xz ruby-4d5513d4697170120a2068e18263d416d5cd9d8b.zip | |
* lib: do not use __send__ to access private methods. [ruby-dev:26935]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9071 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 a573af2ba..6bd14d078 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 # |
