summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@sonarsource.com>2014-08-29 17:52:14 +0200
committerStephane Gamard <stephane.gamard@sonarsource.com>2014-08-29 17:52:14 +0200
commit28c9c5354566365afb1c865a30af1ce4e36075b0 (patch)
tree6161c0e80889c0a86cb482bf88cb36e3e0b7da68
parent7aa4861592da6891836160aabee437419054cf95 (diff)
downloadsonarqube-28c9c5354566365afb1c865a30af1ce4e36075b0.tar.gz
sonarqube-28c9c5354566365afb1c865a30af1ce4e36075b0.zip
SONAR-4898 - forgot a synchronized for JSW
-rw-r--r--server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java
index c1c5d172c4a..5ad365ee338 100644
--- a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java
+++ b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java
@@ -123,25 +123,23 @@ public abstract class MonitoredProcess implements ProcessMXBean {
}
@Override
- public final void terminate() {
- synchronized (monitor) {
- if (monitor != null) {
- LOGGER.debug("Process[{}] terminating", name);
- try {
- doTerminate();
- } catch (Exception e) {
- LOGGER.error("Fail to terminate " + name, e);
- // do not propagate exception
- }
- monitor.shutdownNow();
- monitor = null;
- if (pingTask != null) {
- pingTask.cancel(true);
- pingTask = null;
- }
- LOGGER.debug("Process[{}] terminated", name);
- terminated = true;
+ public final synchronized void terminate() {
+ if (monitor != null) {
+ LOGGER.debug("Process[{}] terminating", name);
+ try {
+ doTerminate();
+ } catch (Exception e) {
+ LOGGER.error("Fail to terminate " + name, e);
+ // do not propagate exception
+ }
+ monitor.shutdownNow();
+ monitor = null;
+ if (pingTask != null) {
+ pingTask.cancel(true);
+ pingTask = null;
}
+ LOGGER.debug("Process[{}] terminated", name);
+ terminated = true;
}
}