Permalink
Browse files

use Process.pid rather than $$

  • Loading branch information...
tenderlove committed Feb 16, 2012
1 parent aaff1a4 commit decafdd57a2c992a15df894cc43cd0a7ff6ea985
@@ -334,7 +334,7 @@ def initialize(pools = Hash.new { |h,k| h[k] = {} })
end
def connection_pools
- @connection_pools[$$]
+ @connection_pools[Process.pid]
end
def establish_connection(name, spec)
@@ -409,20 +409,20 @@ def retrieve_connection_pool(klass)
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]
}
@@ -119,7 +119,7 @@ def clear
private
def cache
- @cache[$$]
+ @cache[Process.pid]
end
end
@@ -359,7 +359,7 @@ def delete(sql_key)
private
def cache
- @cache[$$]
+ @cache[Process.pid]
end
def dealloc(key)

3 comments on commit decafdd

@seban

This comment has been minimized.

Show comment Hide comment
@seban

seban Feb 17, 2012

Is this pure cosmetic change or there is some difference between $$ and Process.pid?

Is this pure cosmetic change or there is some difference between $$ and Process.pid?

@marcbowes

This comment has been minimized.

Show comment Hide comment
@marcbowes

marcbowes Feb 17, 2012

Contributor

Cosmetic.

Contributor

marcbowes replied Feb 17, 2012

Cosmetic.

@tenderlove

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Feb 17, 2012

Member

Totally cosmetic. $$ probably isn't used commonly, and Process.pid is more self explanatory. I'd rather the code be more readable by the next person. :-)

Member

tenderlove replied Feb 17, 2012

Totally cosmetic. $$ probably isn't used commonly, and Process.pid is more self explanatory. I'd rather the code be more readable by the next person. :-)

Please sign in to comment.