[jboss-cvs] JBossAS SVN: r60328 - trunk/server/src/main/org/jboss/invocation/pooled/interfaces.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 6 09:29:12 EST 2007
Author: scottmarlownovell
Date: 2007-02-06 09:29:12 -0500 (Tue, 06 Feb 2007)
New Revision: 60328
Modified:
trunk/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java
Log:
JBAS-4047 Do not hold synchronization lock while testing connection.
Modified: trunk/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java
===================================================================
--- trunk/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java 2007-02-06 14:07:59 UTC (rev 60327)
+++ trunk/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java 2007-02-06 14:29:12 UTC (rev 60328)
@@ -493,17 +493,23 @@
return cs;
}
- protected synchronized ClientSocket getPooledConnection()
+ protected ClientSocket firstConnection()
{
+ synchronized (pool)
+ {
+ if(pool.size() > 0)
+ return (ClientSocket)pool.removeFirst();
+ }
+ return null;
+ }
+
+ protected ClientSocket getPooledConnection()
+ {
ClientSocket socket = null;
- while (pool.size() > 0)
+ while ((socket = firstConnection()) != null)
{
try
{
- synchronized( pool )
- {
- socket = (ClientSocket)pool.removeFirst();
- }
// Test to see if socket is alive by send ACK message
if( trace )
log.trace("Checking pooled socket: "+socket+", address: "+socket.socket.getLocalSocketAddress());
@@ -553,7 +559,7 @@
* @return true if socket was added to the pool, false if the pool
* was full
*/
- protected synchronized boolean returnConnection(ClientSocket socket)
+ protected boolean returnConnection(ClientSocket socket)
{
boolean pooled = false;
synchronized( pool )
More information about the jboss-cvs-commits
mailing list