6929137: java-corba: Locking too broad in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl

Thu, 07 Oct 2010 00:53:49 -0700

author
skoppar
date
Thu, 07 Oct 2010 00:53:49 -0700
changeset 229
5f026ab0098c
parent 228
2d3622317730
child 230
34af2070439b

6929137: java-corba: Locking too broad in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl
Reviewed-by: asaha

src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Thu Oct 07 00:51:42 2010 -0700
     1.2 +++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Thu Oct 07 00:53:49 2010 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -122,9 +122,6 @@
    1.11      implements
    1.12          ClientRequestDispatcher
    1.13  {
    1.14 -    // Used for locking
    1.15 -    private Object lock = new Object();
    1.16 -
    1.17      public OutputObject beginRequest(Object self, String opName,
    1.18                                       boolean isOneWay, ContactInfo contactInfo)
    1.19      {
    1.20 @@ -151,7 +148,8 @@
    1.21  
    1.22          // This locking is done so that multiple connections are not created
    1.23          // for the same endpoint
    1.24 -        synchronized (lock) {
    1.25 +        //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints
    1.26 +        synchronized (contactInfo) {
    1.27              if (contactInfo.isConnectionBased()) {
    1.28                  if (contactInfo.shouldCacheConnection()) {
    1.29                      connection = (CorbaConnection)
    1.30 @@ -256,7 +254,7 @@
    1.31          registerWaiter(messageMediator);
    1.32  
    1.33          // Do connection reclaim now
    1.34 -        synchronized (lock) {
    1.35 +        synchronized (contactInfo) {
    1.36              if (contactInfo.isConnectionBased()) {
    1.37                  if (contactInfo.shouldCacheConnection()) {
    1.38                      OutboundConnectionCache connectionCache =

mercurial