Skip to main content

Thread

Complete API reference for Thread, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Thread

Component: no


public class Thread

Constructors

SignatureDescription
Thread()Creates a new instance of Thread.
Thread(Runnable)Creates a new instance of Thread.
Thread(ThreadGroup, Runnable)Creates a new instance of Thread.
Thread(String)Creates a new instance of Thread.
Thread(ThreadGroup, String)Creates a new instance of Thread.
Thread(Runnable, String)Creates a new instance of Thread.
Thread(ThreadGroup, Runnable, String)Creates a new instance of Thread.
Thread(ThreadGroup, Runnable, String, long)Creates a new instance of Thread.

Methods

SignatureReturnsDescription
start()voidExecutes start and returns after the underlying engine call finishes.
run()voidExecutes run and returns after the underlying engine call finishes.
isInterruptCalled()booleanReturns whether interrupt called is true.
interrupt()voidExecutes interrupt and returns after the underlying engine call finishes.
isInterrupted()booleanReturns whether interrupted is true.
toString()StringReturns the string representation.
getContextClassLoader()ClassLoaderReturns the current context class loader.
setContextClassLoader(ClassLoader)voidSets or updates the context class loader.
getStackTrace()StackTraceElement[]Returns the current stack trace.
getId()longReturns the current id.
getState()StateReturns the current state.
getUncaughtExceptionHandler()UncaughtExceptionHandlerReturns the current uncaught exception handler.
setUncaughtExceptionHandler(UncaughtExceptionHandler)voidSets or updates the uncaught exception handler.
join()voidExecutes join and returns after the underlying engine call finishes.
join(long)voidExecutes join and returns after the underlying engine call finishes.
join(long, int)voidExecutes join and returns after the underlying engine call finishes.
isAlive()booleanReturns whether alive is true.
setPriority(int)voidSets or updates the priority.
getPriority()intReturns the current priority.
setName(String)voidSets or updates the name.
getName()StringReturns the current name.
getThreadGroup()ThreadGroupReturns the current thread group.

Static Methods

SignatureReturnsDescription
update()voidExecutes update and returns after the underlying engine call finishes.
interruptAll()voidExecutes interruptAll and returns after the underlying engine call finishes.
requestEngineThread()voidExecutes requestEngineThread and returns after the underlying engine call finishes.
requestOpenglEngineThread()voidExecutes requestOpenglEngineThread and returns after the underlying engine call finishes.
isEngineThread()booleanExecutes isEngineThread and returns after the underlying engine call finishes.
isOpenglEngineThread()booleanExecutes isOpenglEngineThread and returns after the underlying engine call finishes.
runOnEngine(Runnable)voidPerforms the runOnEngine operation using the provided parameters (runnable).
runOnEngine(float, Runnable)voidPerforms the runOnEngine operation using the provided parameters (delaySeconds, runnable).
runOnUIThread(Runnable)voidPerforms the runOnUIThread operation using the provided parameters (runnable).
sleep(long)voidPerforms the sleep operation using the provided parameters (milis).
sleep(long, int)voidPerforms the sleep operation using the provided parameters (milis, nanos).
dumpStack()voidExecutes dumpStack and returns after the underlying engine call finishes.