提交 d9a2be14 编写于 作者: S skoppar

6980681: CORBA deadlock in Java SE beleived to be related to CR 6238477

Summary: Also reviewed by ken.cavanaugh@oracle.com
Reviewed-by: poonam
上级 ea4dc100
/*
* Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
......@@ -245,7 +245,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
// All access to resolver, localResolver, and urlOperation must be protected using
// resolverLock. Do not hold the ORBImpl lock while accessing
// resolver, or deadlocks may occur.
private Object resolverLock ;
// Note that we now have separate locks for each resolver type. This is due
// to bug 6980681 and 6238477, which was caused by a deadlock while resolving a
// corbaname: URL that contained a reference to the same ORB as the
// ORB making the call to string_to_object. This caused a deadlock between the
// client thread holding the single lock for access to the urlOperation,
// and the server thread handling the client is_a request waiting on the
// same lock to access the localResolver.
// Used for resolver_initial_references and list_initial_services
private Resolver resolver ;
......@@ -255,8 +262,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
// Converts strings to object references for resolvers and string_to_object
private Operation urlOperation ;
private final Object urlOperationLock = new java.lang.Object() ;
private CorbaServerRequestDispatcher insNamingDelegate ;
// resolverLock must be used for all access to either resolver or
// localResolver, since it is possible for the resolver to indirectly
// refer to the localResolver. Also used to protect access to
// insNamingDelegate.
private final Object resolverLock = new Object() ;
private TaggedComponentFactoryFinder taggedComponentFactoryFinder ;
......@@ -396,7 +409,6 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
}
};
resolverLock = new java.lang.Object() ;
requestDispatcherRegistry = new RequestDispatcherRegistryImpl(
this, ORBConstants.DEFAULT_SCID);
......@@ -832,7 +844,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
if (str == null)
throw wrapper.nullParam() ;
synchronized (resolverLock) {
synchronized (urlOperationLock) {
org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
return obj ;
}
......@@ -1773,7 +1785,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
*/
public void setURLOperation( Operation stringToObject )
{
synchronized (resolverLock) {
synchronized (urlOperationLock) {
urlOperation = stringToObject ;
}
}
......@@ -1783,7 +1795,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
*/
public Operation getURLOperation()
{
synchronized (resolverLock) {
synchronized (urlOperationLock) {
return urlOperation ;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册