am 70736a6d: Merge "Avoid starting multiple threads in ShutdownThread" into gingerbread

Merge commit '70736a6d92767258543bb03ac22a705535d86341' into gingerbread-plus-aosp

* commit '70736a6d92767258543bb03ac22a705535d86341':
  Avoid starting multiple threads in ShutdownThread
This commit is contained in:
Mike Lockwood
2010-07-26 12:25:31 -07:00
committed by Android Git Automerger

View File

@@ -84,7 +84,7 @@ public final class ShutdownThread extends Thread {
public static void shutdown(final Context context, boolean confirm) {
// ensure that only one thread is trying to power down.
// any additional calls are just returned
synchronized (sIsStartedGuard){
synchronized (sIsStartedGuard) {
if (sIsStarted) {
Log.d(TAG, "Request to shutdown already running, returning.");
return;
@@ -133,6 +133,10 @@ public final class ShutdownThread extends Thread {
private static void beginShutdownSequence(Context context) {
synchronized (sIsStartedGuard) {
if (sIsStarted) {
Log.d(TAG, "Request to shutdown already running, returning.");
return;
}
sIsStarted = true;
}