Class CodenameOneThread
java.lang.Object
java.lang.Thread
com.codename1.impl.CodenameOneThread
- All Implemented Interfaces:
Runnable
Thread class implementing the crash protection functionality
-
Field Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYModifier and TypeFieldDescriptionstatic final intThe maximum priority that a thread can have.static final intThe minimum priority that a thread can have.static final intThe default priority that is assigned to a thread. -
Constructor Summary
ConstructorsConstructorDescriptionCodenameOneThread(Runnable r, String threadName) Constructor accepting the runnable -
Method Summary
Modifier and TypeMethodDescriptionPrints the stack trace matching the given stackstatic voidhandleException(Throwable err) booleanstatic voidpop()Pops the current method from the stackvoidpopStack()Pops the method stack pointerstatic voidpush(int method) Pushes the method to the current thread stackvoidpushStack(int method) Pushes a method id into the stackvoidrun()Catches exceptionstatic voidstoreStack(Throwable th, int currentStackFrame) Stores the stack for the given exceptionvoidstoreStackForException(Throwable t, int currentStackFrame) Stores the stack for the given exceptionMethods inherited from class Thread
activeCount, currentThread, getName, getPriority, getStackTrace, interrupt, isAlive, join, setPriority, sleep, start, toString, yieldModifier and TypeMethodDescriptionstatic intReturns the current number of active threads in the virtual machine.static ThreadReturns a reference to the currently executing Thread object.final StringgetName()Returns this thread's name.final intReturns this thread's priority.voidInterrupts this thread.final booleanisAlive()Tests if this thread is alive.final voidjoin()Waits for this thread to die.final voidsetPriority(int newPriority) Changes the priority of this thread.static voidsleep(long millis) Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds.voidstart()Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.toString()Returns a string representation of this thread, including the thread's name and priority.static voidyield()Causes the currently executing thread object to temporarily pause and allow other threads to execute.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
CodenameOneThread
-
-
Method Details
-
push
public static void push(int method) Pushes the method to the current thread stack
Parameters
method: the method id
-
pop
public static void pop()Pops the current method from the stack -
storeStack
Stores the stack for the given exception
Parameters
th: the exception mapping to the given stack
-
handleException
-
hasStackFrame
public boolean hasStackFrame() -
pushStack
public void pushStack(int method) Pushes a method id into the stack
Parameters
method: the method id
-
popStack
public void popStack()Pops the method stack pointer -
storeStackForException
Stores the stack for the given exception
Parameters
t: the exception mapping to the given stack
-
getStack
-
run
-