mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
the socket whose last-access-time is oldest. (and add new one) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7255981a4d
commit
bc9d396610
2 changed files with 12 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jul 5 01:20:17 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||
|
||||
* lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
|
||||
the socket whose last-access-time is oldest. (and add new one)
|
||||
|
||||
Sun Jul 4 12:24:50 2004 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/rss.rb: added copyright header.
|
||||
|
|
|
@ -1080,11 +1080,14 @@ module DRb
|
|||
return succ, result
|
||||
|
||||
ensure
|
||||
if conn
|
||||
if succ
|
||||
@mutex.synchronize do
|
||||
if @pool.size > POOL_SIZE or ! succ
|
||||
conn.close if conn
|
||||
else
|
||||
@pool.unshift(conn)
|
||||
@pool.pop.close while @pool.size > POOL_SIZE
|
||||
end
|
||||
else
|
||||
conn.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue