Fixing ConcurrentModificationException
Bug: 120664974 Test: Manual Change-Id: I67e88c6980fbabb9afb9f4946baf731852f19b19
This commit is contained in:
parent
381a75c194
commit
d177aba4a2
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue