Fixing ConcurrentModificationException

Bug: 120664974
Test: Manual
Change-Id: I67e88c6980fbabb9afb9f4946baf731852f19b19
This commit is contained in:
vadimt 2018-12-13 11:53:56 -08:00
parent 381a75c194
commit d177aba4a2
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public class TraceHelper {
private static final boolean SYSTEM_TRACE = false;
private static final ArrayMap<String, MutableLong> sUpTimes = ENABLED ? new ArrayMap<>() : null;
public static void beginSection(String sectionName) {
public static synchronized void beginSection(String sectionName) {
if (ENABLED) {
MutableLong time = sUpTimes.get(sectionName);
if (time == null) {
@ -55,7 +55,7 @@ public class TraceHelper {
}
}
public static void partitionSection(String sectionName, String partition) {
public static synchronized void partitionSection(String sectionName, String partition) {
if (ENABLED) {
MutableLong time = sUpTimes.get(sectionName);
if (time != null && time.value >= 0) {
@ -78,7 +78,7 @@ public class TraceHelper {
}
}
public static void endSection(String sectionName, String msg) {
public static synchronized void endSection(String sectionName, String msg) {
if (ENABLED) {
MutableLong time = sUpTimes.get(sectionName);
if (time != null && time.value >= 0) {