mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
6845161: Bottleneck in Configuration.getConfiguration synchronized call
Reduce scope of synchronized block Reviewed-by: weijun
This commit is contained in:
parent
8a52d1a9d5
commit
46c0719042
1 changed files with 43 additions and 41 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1998-2009 Sun Microsystems, Inc. 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
|
||||
|
@ -234,12 +234,13 @@ public abstract class Configuration {
|
|||
*
|
||||
* @see #setConfiguration
|
||||
*/
|
||||
public static synchronized Configuration getConfiguration() {
|
||||
public static Configuration getConfiguration() {
|
||||
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null)
|
||||
sm.checkPermission(new AuthPermission("getLoginConfiguration"));
|
||||
|
||||
synchronized (Configuration.class) {
|
||||
if (configuration == null) {
|
||||
String config_class = null;
|
||||
config_class = AccessController.doPrivileged
|
||||
|
@ -285,6 +286,7 @@ public abstract class Configuration {
|
|||
}
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the login <code>Configuration</code>.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue