[jboss-cvs] JBossAS SVN: r60313 - branches/Branch_4_2/server/src/main/org/jboss/invocation/pooled/interfaces.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 5 17:28:52 EST 2007
Author: scottmarlownovell
Date: 2007-02-05 17:28:52 -0500 (Mon, 05 Feb 2007)
New Revision: 60313
Modified:
branches/Branch_4_2/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java
Log:
JBAS-4047 Do not synchronize while testing connection.
Modified: branches/Branch_4_2/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java 2007-02-05 21:55:05 UTC (rev 60312)
+++ branches/Branch_4_2/server/src/main/org/jboss/invocation/pooled/interfaces/PooledInvokerProxy.java 2007-02-05 22:28:52 UTC (rev 60313)
@@ -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