Merge "Avoid starting multiple threads in ShutdownThread" into gingerbread

This commit is contained in:
Mike Lockwood
2010-07-26 08:11:54 -07:00
committed by Android (Google) Code Review

View File

@@ -133,6 +133,10 @@ public final class ShutdownThread extends Thread {
private static void beginShutdownSequence(Context context) { private static void beginShutdownSequence(Context context) {
synchronized (sIsStartedGuard) { synchronized (sIsStartedGuard) {
if (sIsStarted) {
Log.d(TAG, "Request to shutdown already running, returning.");
return;
}
sIsStarted = true; sIsStarted = true;
} }