Bug 1191083 - Implement more GeckoThread states; r=snorp
Implement the MOZGLUE_READY and JNI_READY states in GeckoThread. Also change GeckoJavaSampler to use the new states instead of a separate flag.
This commit is contained in:
@@ -19,7 +19,6 @@ public class GeckoJavaSampler {
|
||||
private static Thread sSamplingThread;
|
||||
private static SamplingThread sSamplingRunnable;
|
||||
private static Thread sMainThread;
|
||||
private static volatile boolean sLibsLoaded;
|
||||
|
||||
// Use the same timer primitive as the profiler
|
||||
// to get a perfect sample syncing.
|
||||
@@ -31,7 +30,7 @@ public class GeckoJavaSampler {
|
||||
public long mJavaTime; // non-zero if Android system time is used
|
||||
public Sample(StackTraceElement[] aStack) {
|
||||
mFrames = new Frame[aStack.length];
|
||||
if (sLibsLoaded) {
|
||||
if (GeckoThread.isStateAtLeast(GeckoThread.State.LIBS_READY)) {
|
||||
mTime = getProfilerTime();
|
||||
}
|
||||
if (mTime == 0.0d) {
|
||||
@@ -208,10 +207,6 @@ public class GeckoJavaSampler {
|
||||
sSamplingRunnable = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setLibsLoaded() {
|
||||
sLibsLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user