Fixed coverity reported concurrency issues

Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>
This commit is contained in:
Santhosh Edukulla 2014-08-05 12:13:45 +05:30
parent d26e5163d4
commit e4d6cd8e6a
2 changed files with 2 additions and 17 deletions

View File

@ -236,7 +236,7 @@ public abstract class ServerResourceBase implements ServerResource {
}
protected List<String> getWarnings() {
synchronized (this) {
synchronized (_warnings) {
final ArrayList<String> results = _warnings;
_warnings = new ArrayList<String>();
return results;
@ -244,7 +244,7 @@ public abstract class ServerResourceBase implements ServerResource {
}
protected List<String> getErrors() {
synchronized (this) {
synchronized (_errors) {
final ArrayList<String> result = _errors;
_errors = new ArrayList<String>();
return result;

View File

@ -577,21 +577,6 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
return attache;
}
protected boolean notifyCreatorsOfConnection(StartupCommand[] cmd) throws ConnectionException {
boolean handled = false;
for (Pair<Integer, StartupCommandProcessor> monitor : _creationMonitors) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Sending Connect to creator: " + monitor.second().getClass().getSimpleName());
}
handled = monitor.second().processInitialConnect(cmd);
if (handled) {
break;
}
}
return handled;
}
@Override
public boolean start() {
startDirectlyConnectedHosts();