Class RealtimeThread
java.lang.Object
com.codename1.realtime.RealtimeThread
A thread that runs a RealtimeTask once per period. Created and started by
Realtime.start(String, RealtimeParameters, RealtimeTask).
The thread applies its scheduling, runs the task's setup(), freezes allocation and
then loops: wait for the next release, run cycle(). stop() ends the loop after
the cycle in progress.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intgetState(): ended by a failure, seegetFailure().static final intgetState(): running cycles.static final intgetState(): created, not yet running cycles.static final intgetState(): ended bystop(). -
Method Summary
Modifier and TypeMethodDescriptiongetName()The name given at start.intgetState()One of theSTATE_constants.A snapshot of the thread's statistics, as of the last completed cycle.booleantruewhen the thread was pinned to the CPU its parameters named.booleantruewhen the operating system granted real-time scheduling.voidjoin(long millis) Waits for the thread to exit.voidstop()Ends the loop after the cycle in progress.
-
Field Details
-
STATE_STARTING
-
STATE_RUNNING
-
STATE_STOPPED
-
STATE_FAILED
-
-
Method Details
-
getName
The name given at start. -
getState
public int getState()One of theSTATE_constants. -
getFailure
-
isSchedulingApplied
public boolean isSchedulingApplied()truewhen the operating system granted real-time scheduling.falseon a platform without it, or a process without the privilege, where the task runs at normal priority. -
isCpuPinned
public boolean isCpuPinned()truewhen the thread was pinned to the CPU its parameters named. -
getStatistics
A snapshot of the thread's statistics, as of the last completed cycle. -
stop
public void stop()Ends the loop after the cycle in progress. The thread then calls the task'sstopped()and exits. Returns at once; usejoin(long)to wait. -
join
Waits for the thread to exit.
Parameters
millis: the longest to wait, 0 for no limit
- Throws:
InterruptedException
-