FileDocCategorySizeDatePackage
VMThread.javaAPI DocAndroid 1.5 API3434Wed May 06 22:41:04 BST 2009java.lang

VMThread

public class VMThread extends Object

Fields Summary
Thread
thread
int
vmData
private static final String
UNSUPPORTED_THREAD_METHOD
static final Thread$State[]
STATE_MAP
Holds a mapping from native Thread statii to Java one. Required for translating back the result of getStatus().
Constructors Summary
VMThread(Thread t)

        thread = t;
    
Methods Summary
static native voidcreate(java.lang.Thread t, long stacksize)

static native java.lang.ThreadcurrentThread()

native intgetStatus()

native booleanholdsLock(java.lang.Object object)
Queries whether this Thread holds a monitor lock on the given object.

native voidinterrupt()

static native booleaninterrupted()

native booleanisInterrupted()

native voidnameChanged(java.lang.String newName)
Tell the VM that the thread's name has changed. This is useful for DDMS, which would otherwise be oblivious to Thread.setName calls.

voidresume()
Resumes the Thread, assuming it is suspended.

        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
                new UnsupportedOperationException());
    
native voidsetPriority(int newPriority)

static native voidsleep(long msec, int nsec)

voidstart(long stacksize)
Starts the VMThread (and thus the Java Thread) with the given stacksize.

param
stacksize The desired stacksize.

        VMThread.create(thread, stacksize);
    
voidstop(java.lang.Throwable throwable)
Stops the Thread, passing it a Throwable (which might be ThreadDeath).

        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
                new UnsupportedOperationException());
    
voidsuspend()
Suspends the Thread.

        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
                new UnsupportedOperationException());
    
static native voidyield()