summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjungwook.ryu <jungwook.ryu@samsung.com>2014-03-28 16:53:34 +0900
committerjungwook.ryu <jungwook.ryu@samsung.com>2014-03-28 16:53:57 +0900
commit187b7bb43a6e1c7f4a64a3d0f8fb0a9ce68855a5 (patch)
treeae05d1bb29b5ccb4572f69496f067e08e5b318b1
parentbe957b4b69bf06a75490091cd9408bd2be6e5368 (diff)
downloaddynamic-analysis-ide-eplugin-187b7bb43a6e1c7f4a64a3d0f8fb0a9ce68855a5.tar.gz
dynamic-analysis-ide-eplugin-187b7bb43a6e1c7f4a64a3d0f8fb0a9ce68855a5.tar.bz2
dynamic-analysis-ide-eplugin-187b7bb43a6e1c7f4a64a3d0f8fb0a9ce68855a5.zip
MISC: fix potential bug - misuse concurrency method (synchronized, wait, notify)
Change-Id: I7d8dc216aff4a7b3b68ee6ae1cc043bef9292d33 Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
-rw-r--r--org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/communication/DAServerManager.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/communication/DAServerManager.java b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/communication/DAServerManager.java
index 67d508f..cfee34b 100644
--- a/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/communication/DAServerManager.java
+++ b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/communication/DAServerManager.java
@@ -73,7 +73,6 @@ public class DAServerManager extends Thread {
private final String CURRENT_ACTIVE_IDE_PORT = "current_active_ide_port"; //$NON-NLS-1$
private static boolean recvDAReadyStatus = false;
- private final static Object recvDataEvent = new Object(); // Lock for synchronous communication
public synchronized static DAServerManager getInstance() {
if (instance == null) {
@@ -315,9 +314,9 @@ public class DAServerManager extends Thread {
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR,
Labels.MESSAGE_FAIL_TO_LAUNCH_PROJECT);
}
- synchronized (recvDataEvent) {
+ synchronized (this) {
try {
- recvDataEvent.wait(10000);
+ this.wait(10000);
} catch (InterruptedException e) {
DALog.printLog("DAServerManager - sendDAStatusMessage - getRecvDAReadyStatus().wait(10000)");
// TODO Auto-generated catch block
@@ -362,7 +361,7 @@ public class DAServerManager extends Thread {
}
}
- private void setDAStatus(final String[] msgArray) { // DA Status
+ private synchronized void setDAStatus(final String[] msgArray) { // DA Status
if (msgArray[1].equals(IDE_DA_COMMUNICATION_TYPE_1_RECORD)) {
setRecvDAReadyStatus(false);
} else if (msgArray[1].equals(IDE_DA_COMMUNICATION_TYPE_1_STOP)) {
@@ -370,9 +369,7 @@ public class DAServerManager extends Thread {
} else {
DALog.printLog("receive message is not valid");//$NON-NLS-1$
}
- synchronized (recvDataEvent) {
- recvDataEvent.notify();
- }
+ this.notify();
}
private void viewSouceLine(final String[] msgArray) {