FileDocCategorySizeDatePackage
BackgroundThread.javaAPI DocAndroid 1.5 API1593Wed May 06 22:41:08 BST 2009com.android.ddmuilib

BackgroundThread

public abstract class BackgroundThread extends Thread
base background thread class. The class provides a synchronous quit method which sets a quitting flag to true. Inheriting classes should regularly test this flag with isQuitting() and should finish if the flag is true.

Fields Summary
private boolean
mQuit
Constructors Summary
Methods Summary
protected final booleanisQuitting()
returns if the thread was asked to quit.

        return mQuit;
    
public final voidquit()
Tell the thread to exit. This is usually called from the UI thread. The call is synchronous and will only return once the thread has terminated itself.


                                    
        
        mQuit = true;
        Log.d("ddms", "Waiting for BackgroundThread to quit");
        try {
            this.join();
        } catch (InterruptedException ie) {
            ie.printStackTrace();
        }