mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
Removed unnecessary synchronization lock from serverSwitch constructor
Lock was useless here as it was set on an object instance attribute while the object itself is not yet constructed and no other threads can access it.
This commit is contained in:
parent
dcee2ee6a6
commit
d5f44ea216
|
@ -113,27 +113,25 @@ public class serverSwitch {
|
|||
|
||||
// remove all values from config that do not appear in init
|
||||
this.configRemoved = new ConcurrentHashMap<String, String>();
|
||||
synchronized (this.configProps) {
|
||||
Iterator<String> i = this.configProps.keySet().iterator();
|
||||
String key;
|
||||
while (i.hasNext()) {
|
||||
key = i.next();
|
||||
if (!(initProps.containsKey(key))) {
|
||||
this.configRemoved.put(key, this.configProps.get(key));
|
||||
i.remove();
|
||||
}
|
||||
Iterator<String> i = this.configProps.keySet().iterator();
|
||||
String key;
|
||||
while (i.hasNext()) {
|
||||
key = i.next();
|
||||
if (!(initProps.containsKey(key))) {
|
||||
this.configRemoved.put(key, this.configProps.get(key));
|
||||
i.remove();
|
||||
}
|
||||
|
||||
// merge new props from init to config
|
||||
// this is necessary for migration, when new properties are attached
|
||||
initProps.putAll(this.configProps);
|
||||
this.configProps = initProps;
|
||||
|
||||
// save result; this may initially create a config file after
|
||||
// initialization
|
||||
saveConfig();
|
||||
}
|
||||
|
||||
// merge new props from init to config
|
||||
// this is necessary for migration, when new properties are attached
|
||||
initProps.putAll(this.configProps);
|
||||
this.configProps = initProps;
|
||||
|
||||
// save result; this may initially create a config file after
|
||||
// initialization
|
||||
saveConfig();
|
||||
|
||||
// init thread control
|
||||
this.workerThreads = new TreeMap<String, BusyThread>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user