Improving synchronization in TraceControl
@@ -362,8 +362,11 @@ public final class TraceControl {
synchronized (this) {
ensureHandlerInitialized();
+ // It's a guard if trace stop was initiated from another thread.
+ if (findCurrentTraceByTraceId(nextContext.traceId) != null) {
mTraceControlHandler.onTraceStart(nextContext, timeout);
}
+ }
return true;
}
