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:
Jim Chen
2015-08-13 00:53:38 -04:00
parent cea34e4151
commit 21228b0730
2 changed files with 7 additions and 7 deletions

View File

@@ -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;
}
}