adds synchornized dumplog

pull/621/head
sgaebel 4 years ago
parent fdc6311dc7
commit 0663ae3c99

@ -191,13 +191,17 @@ public class AccessTracker {
public static void dumpLog() { public static void dumpLog() {
lastLogDump = System.currentTimeMillis(); lastLogDump = System.currentTimeMillis();
localCount += localSearches.size(); localCount += localSearches.size();
synchronized (localSearches) {
while (!localSearches.isEmpty()) { while (!localSearches.isEmpty()) {
addToDump(localSearches.removeFirst(), 0); addToDump(localSearches.removeFirst(), 0);
} }
}
remoteCount += remoteSearches.size(); remoteCount += remoteSearches.size();
synchronized (remoteSearches) {
while (!remoteSearches.isEmpty()) { while (!remoteSearches.isEmpty()) {
addToDump(remoteSearches.removeFirst(), 0); addToDump(remoteSearches.removeFirst(), 0);
} }
}
Thread t = new Thread("AccessTracker.dumpLog") { Thread t = new Thread("AccessTracker.dumpLog") {
@Override @Override
public void run() { public void run() {

Loading…
Cancel
Save