Skip to content

Commit d8beb20

Browse files
authored
Merge pull request #425 from slacmshankar/Issue_424
Fix potential deadlocks in EPICS_V3_PV
2 parents b85f088 + eb8a19d commit d8beb20

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/org/epics/archiverappliance/engine/pv/EPICS_V3_PV.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,6 @@ public void run() {
565565
}
566566
});
567567
} else {
568-
Monitor sub_copy;
569-
synchronized (this) {
570-
sub_copy = subscription;
571-
state = PVConnectionState.Disconnected;
572-
connected = false;
573-
subscription = null;
574-
}
575568
PVContext.scheduleCommand(
576569
this.name,
577570
this.jcaCommandThreadId,
@@ -580,6 +573,13 @@ public void run() {
580573
new Runnable() {
581574
@Override
582575
public void run() {
576+
Monitor sub_copy;
577+
synchronized (this) {
578+
sub_copy = subscription;
579+
state = PVConnectionState.Disconnected;
580+
connected = false;
581+
subscription = null;
582+
}
583583
if (sub_copy != null) {
584584
try {
585585
sub_copy.clear();
@@ -1059,9 +1059,7 @@ public void aboutToWriteBuffer(DBRTimeEvent lastEvent) {
10591059
HashMap<String, String> tempHashMap = new HashMap<>(changedarchiveFieldsData);
10601060
// dbrtimeevent.s
10611061
lastEvent.setFieldValues(tempHashMap, true);
1062-
synchronized (this) {
1063-
changedarchiveFieldsData.clear();
1064-
}
1062+
changedarchiveFieldsData.clear();
10651063
}
10661064
if (!allarchiveFieldsData.isEmpty()) {
10671065
long nowES = TimeUtils.getCurrentEpochSeconds();

0 commit comments

Comments
 (0)