changeset 228:5f026ab0098c

6929137: java-corba: Locking too broad in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl Reviewed-by: asaha
author skoppar
date Thu, 07 Oct 2010 00:53:49 -0700
parents 2d3622317730
children 34af2070439b
files src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Thu Oct 07 00:51:42 2010 -0700
+++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Thu Oct 07 00:53:49 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,9 +122,6 @@
     implements
         ClientRequestDispatcher
 {
-    // Used for locking
-    private Object lock = new Object();
-
     public OutputObject beginRequest(Object self, String opName,
                                      boolean isOneWay, ContactInfo contactInfo)
     {
@@ -151,7 +148,8 @@
 
         // This locking is done so that multiple connections are not created
         // for the same endpoint
-        synchronized (lock) {
+        //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints
+        synchronized (contactInfo) {
             if (contactInfo.isConnectionBased()) {
                 if (contactInfo.shouldCacheConnection()) {
                     connection = (CorbaConnection)
@@ -256,7 +254,7 @@
         registerWaiter(messageMediator);
 
         // Do connection reclaim now
-        synchronized (lock) {
+        synchronized (contactInfo) {
             if (contactInfo.isConnectionBased()) {
                 if (contactInfo.shouldCacheConnection()) {
                     OutboundConnectionCache connectionCache =