mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixed few coverity issues for resource synchronization
This commit is contained in:
parent
73ac5dd9d0
commit
b7d3f1bd30
@ -272,16 +272,14 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
public int registerForInitialConnects(final StartupCommandProcessor creator, boolean priority) {
|
||||
synchronized (_hostMonitors) {
|
||||
_monitorId++;
|
||||
|
||||
if (priority) {
|
||||
_creationMonitors.add(0, new Pair<Integer, StartupCommandProcessor>(_monitorId, creator));
|
||||
} else {
|
||||
_creationMonitors.add(new Pair<Integer, StartupCommandProcessor>(_monitorId, creator));
|
||||
}
|
||||
}
|
||||
|
||||
return _monitorId;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterForHostEvents(final int id) {
|
||||
|
||||
@ -1438,11 +1438,10 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
|
||||
|
||||
@Override
|
||||
public void registerResourceStateAdapter(String name, ResourceStateAdapter adapter) {
|
||||
synchronized (_resourceStateAdapters) {
|
||||
if (_resourceStateAdapters.get(name) != null) {
|
||||
throw new CloudRuntimeException(name + " has registered");
|
||||
}
|
||||
|
||||
synchronized (_resourceStateAdapters) {
|
||||
_resourceStateAdapters.put(name, adapter);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user