diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-16 14:49:21 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-16 14:49:21 -0800 |
commit | decafdd57a2c992a15df894cc43cd0a7ff6ea985 (patch) | |
tree | 01ca576165a8355cd6580ce56d31b264bc73effe /activerecord/lib/active_record/connection_adapters | |
parent | aaff1a4101605b7d2e2386d3e7612a43fbe07c8d (diff) | |
download | rails-decafdd57a2c992a15df894cc43cd0a7ff6ea985.tar.gz rails-decafdd57a2c992a15df894cc43cd0a7ff6ea985.tar.bz2 rails-decafdd57a2c992a15df894cc43cd0a7ff6ea985.zip |
use Process.pid rather than $$
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
3 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index 7cbf01ec65..06b9bc5765 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -334,7 +334,7 @@ module ActiveRecord end def connection_pools - @connection_pools[$$] + @connection_pools[Process.pid] end def establish_connection(name, spec) @@ -409,20 +409,20 @@ module ActiveRecord private def class_to_pool - @class_to_pool[$$] + @class_to_pool[Process.pid] end def set_pool_for_spec(spec, pool) - @connection_pools[$$][spec] = pool + @connection_pools[Process.pid][spec] = pool end def set_class_to_pool(name, pool) - @class_to_pool[$$][name] = pool + @class_to_pool[Process.pid][name] = pool pool end def get_pool_for_class(klass) - @class_to_pool[$$].fetch(klass) { + @class_to_pool[Process.pid].fetch(klass) { c_to_p = @class_to_pool.values.find { |class_to_pool| class_to_pool[klass] } diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 5905242747..724dbff1f0 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -119,7 +119,7 @@ module ActiveRecord private def cache - @cache[$$] + @cache[Process.pid] end end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 7414d38aea..d04f04b201 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -359,7 +359,7 @@ module ActiveRecord private def cache - @cache[$$] + @cache[Process.pid] end def dealloc(key) |