javax.realtime
Class RealtimeThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjavax.realtime.RealtimeThread
All Implemented Interfaces:
Runnable, Schedulable
Direct Known Subclasses:
NoHeapRealtimeThread

public class RealtimeThread
extends Thread
implements Schedulable

RealtimeThread extends Thread and includes classes and methods to get and set parameter objects, manage the execution of those threads with a ReleaseParameters type of PeriodicParameters , and waiting. A RealtimeThread object must be placed in a memory area such that thread logic may unexceptionally access instance variables and such that Java methods on Thread (e.g., enumerate and join) complete normally except where such execution would cause access violations. Parameters for constructors may be null . In such cases the default value will be the default value set for the particular type by the associated instance of Scheduler.

Author:
Angelo Corsaro

Field Summary
protected  AsyncEventHandler deadlineMissHandler
           
protected  javax.realtime.ExecutionEligibilityParameters eligibilityParam
           
protected  ProcessingGroupParameters groupParam
           
protected  boolean hasMissedDeadline
           
protected  boolean hasMissHandlers
           
protected  boolean hasOverrun
           
protected  boolean hasOverrunHandlers
           
protected  boolean hasStarted
           
protected  boolean hasStartedTimer
           
protected  boolean isPeriodic
           
protected  Runnable logic
           
protected  MemoryParameters memoryParam
           
protected  EventVariable missCondition
           
protected  AsyncEventHandler overrunHandler
           
protected  boolean periodExpired
           
protected  gnu.gcj.RawData pipeID_
           
protected  ReleaseParameters releaseParam
           
protected  Scheduler scheduler
           
protected  SchedulingParameters schedulingParam
           
protected  gnu.gcj.RawData scopeStack
           
protected  gnu.gcj.RawData timeoutHandler_
           
protected  boolean waitingForNextPeriod
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RealtimeThread()
          Creates a new RealtimeThread instance.
RealtimeThread(Runnable logic)
          Creates a new RealtimeThread instance.
RealtimeThread(SchedulingParameters schedulingParam)
          Creates a new RealtimeThread instance with given SchedulingParameters
RealtimeThread(SchedulingParameters schedulingParam, ReleaseParameters releaseParam)
          Creates a new RealtimeThread instance with given SchedulingParameters and ReleaseParameters.
RealtimeThread(SchedulingParameters schedulingParam, ReleaseParameters releaseParam, MemoryParameters memoryParam, MemoryArea memoryArea, ProcessingGroupParameters groupParam, Runnable logic)
          Creates a new RealtimeThread instance with the given characteristics and a java.lang.Runnable.
 
Method Summary
 boolean addIfFeasible()
          Add to the feasibility of the already set scheduler if the resulting feasibility set is schedulable.
 boolean addToFeasibility()
          Inform the scheduler and cooperating facilities that the resource demands (as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters) of this instance of Schedulable will be considered in the feasibility analysis of the associated Scheduler until further notice.
static RealtimeThread currentRealtimeThread()
          Gets the currently running RealtimeThread.
 void deschedulePeriodic()
          Stop unblocking waitForNextPeriod() for a periodic schedulable object.
 int executionEligibility()
          NOTE: This method is not part of the RTSJ Specification.
 MemoryArea getActiveMemoryArea()
           
static MemoryArea getCurrentMemoryArea()
          Return the instance of MemoryArea which is the current memory area for this.
protected  int getInitialMemoryAreaIndex_()
           
static int getInitialMemoryAreaIndex()
          Memory area stacks include inherited stacks from parent threads.
 int getMemoryAreaStackDepth_()
           
static int getMemoryAreaStackDepth()
          Get the size of the stack of MemoryArea instances to which this RealtimeThread has access.
 MemoryParameters getMemoryParameters()
          Get the MemoryParameters of this schedulable object.
protected  MemoryArea getOuterMemoryArea_(int index)
           
static MemoryArea getOuterMemoryArea(int index)
          Get the instance of MemoryArea in the memory area stack at the index given.
 ProcessingGroupParameters getProcessingGroupParameters()
          Get the ProcessingGroupParameters of this schedulable object.
 ReleaseParameters getReleaseParameters()
          Get the ReleaseParameters of this schedulable object.
 Scheduler getScheduler()
          Get the Scheduler for this schedulable object.
 SchedulingParameters getSchedulingParameters()
          Get the SchedulingParameters for this schedulable object.
protected  gnu.gcj.RawData getScopeStack()
           
 void interrupt()
           
 boolean removeFromFeasibility()
          Inform the scheduler and cooperating facilities that the resource demands, as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of this instance of Schedulable should no longer be considered in the feasibility analysis of the associated Scheduler.
protected  void rtfini_()
           
 void run()
           
 void schedulePeriodic()
          Begin unblocking waitForNextPeriod() for a periodic thread.
 boolean setIfFeasible(ReleaseParameters releaseParam, MemoryParameters memoryParam)
          Returns true if, after considering the values of the parameters, the task set would still be feasible.
 boolean setIfFeasible(ReleaseParameters releaseParam, MemoryParameters memoryParam, ProcessingGroupParameters groupParam)
          Returns true if, after considering the values of the parameters, the task set would still be feasible.
 boolean setIfFeasible(ReleaseParameters releaseParam, ProcessingGroupParameters groupParam)
          Returns true if, after considering the values of the parameters, the task set would still be feasible.
 void setMemoryParameters(MemoryParameters memoryParam)
          Set the MemoryParameters for this schedulable object.
 boolean setMemoryParametersIfFeasible(MemoryParameters memoryParam)
          Returns true if, after considering the value of the parameter, the task set would still be feasible.
 void setProcessingGroupParameters(ProcessingGroupParameters groupParam)
          Set the ProcessingGroupParameters for this schedulable object.
 boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters groupParam)
          Set the ProcessingGroupParameters of this schedulable object only if the resulting task set is feasible.
 void setReleaseParameters(ReleaseParameters releaseParam)
          Set the ReleaseParametersfor this schedulable object.
 boolean setReleaseParametersIfFeasible(ReleaseParameters releaseParam)
          Returns true if, after considering the value of the parameter, the task set would still be feasible.
 void setScheduler(Scheduler scheduler)
          Set the Scheduler for this schedulable object.
 void setScheduler(Scheduler scheduler, SchedulingParameters schedulingParam, ReleaseParameters releaseParam, MemoryParameters memoryParam, ProcessingGroupParameters groupParam)
          Set the Scheduler for this schedulable object.
 void setSchedulingParameters(SchedulingParameters schedulingParam)
          Set the SchedulingParameters for this schedulable object only if the resulting task set is feasible.
 boolean setSchedulingParametersIfFeasible(SchedulingParameters schedulingParam)
          Set the SchedulingParameters for this schedulable object.
protected  boolean setTopMemoryArea(MemoryArea memoryArea)
           
protected  void setupTimeoutHandler()
           
 void setupTSS()
           
static void sleep(AbsoluteTime time)
          An accurate timer with nanosecond granularity.
static void sleep(Clock clock, AbsoluteTime time)
          An accurate timer with nanosecond granularity.
static void sleep(Clock clock, HighResolutionTime time)
          Deprecated. Use the approriate method i.e. the one that has either RelativeTime or AbsoluteTime.
static void sleep(Clock clock, RelativeTime time)
          An accurate timer with nanosecond granularity.
static void sleep(HighResolutionTime time)
          An accurate timer with nanosecond granularity.
static void sleep(RelativeTime time)
          An accurate timer with nanosecond granularity.
 void start()
          Checks if the instance of RealtimeThread is startable and starts it if it is.
protected  void updatePeriodicParameters()
           
protected  boolean validateSchedulingParameters()
           
 boolean waitForNextPeriod()
          Used by threads that have a reference to a ReleaseParameters type of PeriodicParameters to block until the start of each period.
static void yield()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

schedulingParam

protected SchedulingParameters schedulingParam

releaseParam

protected ReleaseParameters releaseParam

memoryParam

protected MemoryParameters memoryParam

groupParam

protected ProcessingGroupParameters groupParam

logic

protected Runnable logic

scheduler

protected Scheduler scheduler

hasStarted

protected boolean hasStarted

scopeStack

protected gnu.gcj.RawData scopeStack

isPeriodic

protected boolean isPeriodic

timeoutHandler_

protected gnu.gcj.RawData timeoutHandler_

pipeID_

protected gnu.gcj.RawData pipeID_

deadlineMissHandler

protected AsyncEventHandler deadlineMissHandler

overrunHandler

protected AsyncEventHandler overrunHandler

hasStartedTimer

protected boolean hasStartedTimer

periodExpired

protected boolean periodExpired

hasMissedDeadline

protected boolean hasMissedDeadline

hasOverrun

protected boolean hasOverrun

hasMissHandlers

protected boolean hasMissHandlers

hasOverrunHandlers

protected boolean hasOverrunHandlers

waitingForNextPeriod

protected boolean waitingForNextPeriod

missCondition

protected EventVariable missCondition

eligibilityParam

protected javax.realtime.ExecutionEligibilityParameters eligibilityParam
Constructor Detail

RealtimeThread

public RealtimeThread()
Creates a new RealtimeThread instance. All parameter values are null.


RealtimeThread

public RealtimeThread(SchedulingParameters schedulingParam)
Creates a new RealtimeThread instance with given SchedulingParameters

Parameters:
schedulingParam - -The SchedulingParameters associated with this (and possibly other instances of RealtimeThread ).

RealtimeThread

public RealtimeThread(SchedulingParameters schedulingParam,
                      ReleaseParameters releaseParam)
Creates a new RealtimeThread instance with given SchedulingParameters and ReleaseParameters.

Parameters:
schedulingParam - -The SchedulingParameters associated with this (and possibly other instances of RealtimeThread ).
releaseParam - -The ReleaseParameters associated with this (and possibly other instances of RealtimeThread ).

RealtimeThread

public RealtimeThread(SchedulingParameters schedulingParam,
                      ReleaseParameters releaseParam,
                      MemoryParameters memoryParam,
                      MemoryArea memoryArea,
                      ProcessingGroupParameters groupParam,
                      Runnable logic)
Creates a new RealtimeThread instance with the given characteristics and a java.lang.Runnable.

Parameters:
schedulingParam - The SchedulingParameters associated with this (and possibly other instances of RealtimeThread).
releaseParam - The ReleaseParameters associated with this (and possibly other instances of RealtimeThread).
memoryParam - The MemoryParameters associated with this (and possibly other instances of RealtimeThread).
memoryArea - The MemoryArea associated with this.
groupParam - -The ProcessingGroupParameters associated with this (and possibly other instances of RealtimeThread).
logic - the logic for this thread.

RealtimeThread

public RealtimeThread(Runnable logic)
Creates a new RealtimeThread instance. All parameter values are null, but the logic.

Parameters:
logic - a Runnable representing the thread logic.
Method Detail

currentRealtimeThread

public static RealtimeThread currentRealtimeThread()
                                            throws ClassCastException
Gets the currently running RealtimeThread.

Returns:
a RealtimeThread value representing the thread the is running now.
Throws:
RuntimeException - if the current running thread is not Realtime.
ClassCastException

addIfFeasible

public boolean addIfFeasible()
Add to the feasibility of the already set scheduler if the resulting feasibility set is schedulable. If successful return true, if not return false. If there is not an assigned scheduler it will return false.

Specified by:
addIfFeasible in interface Schedulable
Returns:
If successful return true, if not return false. If there is not an assigned scheduler it will return false.

setIfFeasible

public boolean setIfFeasible(ReleaseParameters releaseParam,
                             MemoryParameters memoryParam)
Returns true if, after considering the values of the parameters, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the values of the parameters, the task set would not be feasible. In this case the values of the parameters are not changed.

Parameters:
releaseParam - a ReleaseParameters value
memoryParam - a MemoryParameters value
Returns:
true if the resulting system is feasible, false otherwise.

setIfFeasible

public boolean setIfFeasible(ReleaseParameters releaseParam,
                             MemoryParameters memoryParam,
                             ProcessingGroupParameters groupParam)
Returns true if, after considering the values of the parameters, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the values of the parameters, the task set would not be feasible. In this case the values of the parameters are not changed.

Parameters:
releaseParam - a ReleaseParameters value
memoryParam - a MemoryParameters value
groupParam - a ProcessingGroupParameters value
Returns:
true if the resulting system is feasible, false otherwise.

setIfFeasible

public boolean setIfFeasible(ReleaseParameters releaseParam,
                             ProcessingGroupParameters groupParam)
Returns true if, after considering the values of the parameters, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the values of the parameters, the task set would not be feasible. In this case the values of the parameters are not changed.

Parameters:
releaseParam - a ReleaseParameters value
groupParam - a ProcessingGroupParameters value
Returns:
true if the resulting system is feasible, false otherwise.

schedulePeriodic

public void schedulePeriodic()
Begin unblocking waitForNextPeriod() for a periodic thread. Typically used when a periodic schedulable object is in an overrun condition. The scheduler should recompute the schedule and perform admission control. If this does not have a type of PeriodicParameters as it ReleaseParameters nothing happens.


deschedulePeriodic

public void deschedulePeriodic()
Stop unblocking waitForNextPeriod() for a periodic schedulable object. If this does not have a type of PeriodicParameters as it ReleaseParameters nothing happens.


getCurrentMemoryArea

public static MemoryArea getCurrentMemoryArea()
Return the instance of MemoryArea which is the current memory area for this.

Returns:
a MemoryArea value

getInitialMemoryAreaIndex

public static int getInitialMemoryAreaIndex()
Memory area stacks include inherited stacks from parent threads. The inital memory area for the current RealtimeThread is the memory area given as a parameter to the constructor. This method returns the position in the memory area stack of that initial memory area.

Returns:
The index into the memory area stack of the inital memory area of the current RealtimeThread

getMemoryAreaStackDepth

public static int getMemoryAreaStackDepth()
Get the size of the stack of MemoryArea instances to which this RealtimeThread has access.

Returns:
The size of the stack of MemoryArea instances.

getOuterMemoryArea

public static MemoryArea getOuterMemoryArea(int index)
Get the instance of MemoryArea in the memory area stack at the index given. If the given index does not exist in the memory area scope stack then null is returned.

Parameters:
index - The offset into the memory area stack.
Returns:
The instance of MemoryArea at index or null if the given value is does not correspond to a position in the stack.

interrupt

public void interrupt()

addToFeasibility

public boolean addToFeasibility()
Inform the scheduler and cooperating facilities that the resource demands (as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters) of this instance of Schedulable will be considered in the feasibility analysis of the associated Scheduler until further notice. Whether the resulting system is feasible or not, the addition is completed.

Specified by:
addToFeasibility in interface Schedulable
Returns:
true If the resulting system is feasible.

getMemoryParameters

public MemoryParameters getMemoryParameters()
Get the MemoryParameters of this schedulable object.

Specified by:
getMemoryParameters in interface Schedulable
Returns:
a MemoryParameters value.

setMemoryParameters

public void setMemoryParameters(MemoryParameters memoryParam)
Set the MemoryParameters for this schedulable object.

Specified by:
setMemoryParameters in interface Schedulable
Parameters:
memoryParam - the MemoryParameters for this schedulable object.

setMemoryParametersIfFeasible

public boolean setMemoryParametersIfFeasible(MemoryParameters memoryParam)
Returns true if, after considering the value of the parameter, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the value of the parameter, the task set would not be feasible. In this case the values of the parameters are not changed.

Specified by:
setMemoryParametersIfFeasible in interface Schedulable
Parameters:
memoryParam - the MemoryParameters for this schedulable object.
Returns:
true if the requested change keeps the system feasible.

getProcessingGroupParameters

public ProcessingGroupParameters getProcessingGroupParameters()
Get the ProcessingGroupParameters of this schedulable object.

Specified by:
getProcessingGroupParameters in interface Schedulable
Returns:
a ProcessingGroupParameters value

setProcessingGroupParameters

public void setProcessingGroupParameters(ProcessingGroupParameters groupParam)
Set the ProcessingGroupParameters for this schedulable object.

Specified by:
setProcessingGroupParameters in interface Schedulable
Parameters:
groupParam - a ProcessingGroupParameters value

setProcessingGroupParametersIfFeasible

public boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters groupParam)
Set the ProcessingGroupParameters of this schedulable object only if the resulting task set is feasible.

Specified by:
setProcessingGroupParametersIfFeasible in interface Schedulable
Parameters:
groupParam - a ProcessingGroupParameters value
Returns:
Returns true if, after considering the values of the parameters, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the values of the parameters, the task set would not be feasible. In this case the values of the parameters are not changed.

getReleaseParameters

public ReleaseParameters getReleaseParameters()
Get the ReleaseParameters of this schedulable object.

Specified by:
getReleaseParameters in interface Schedulable
Returns:
a ReleaseParameters value

setReleaseParameters

public void setReleaseParameters(ReleaseParameters releaseParam)
                          throws IllegalThreadStateException
Set the ReleaseParametersfor this schedulable object.

Specified by:
setReleaseParameters in interface Schedulable
Parameters:
releaseParam - a ReleaseParameters value
Throws:
IllegalThreadStateException

setReleaseParametersIfFeasible

public boolean setReleaseParametersIfFeasible(ReleaseParameters releaseParam)
Returns true if, after considering the value of the parameter, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the value of the parameter, the task set would not be feasible. In this case the values of the parameters are not changed. the resulting task set is feasible.

Specified by:
setReleaseParametersIfFeasible in interface Schedulable
Parameters:
releaseParam - a ReleaseParameters value

getScheduler

public Scheduler getScheduler()
Get the Scheduler for this schedulable object.

Specified by:
getScheduler in interface Schedulable
Returns:
a Scheduler value

setScheduler

public void setScheduler(Scheduler scheduler)
                  throws IllegalThreadStateException
Set the Scheduler for this schedulable object.

Specified by:
setScheduler in interface Schedulable
Parameters:
scheduler - the scheduler.
Throws:
IllegalThreadStateException

setScheduler

public void setScheduler(Scheduler scheduler,
                         SchedulingParameters schedulingParam,
                         ReleaseParameters releaseParam,
                         MemoryParameters memoryParam,
                         ProcessingGroupParameters groupParam)
                  throws IllegalThreadStateException
Set the Scheduler for this schedulable object.

Specified by:
setScheduler in interface Schedulable
Parameters:
scheduler - a Scheduler value
schedulingParam - a SchedulingParameters value
releaseParam - a ReleaseParameters value
memoryParam - a MemoryParameters value
groupParam - a ProcessingGroupParameters value
Throws:
IllegalThreadStateException - if an error occurs

getSchedulingParameters

public SchedulingParameters getSchedulingParameters()
Get the SchedulingParameters for this schedulable object.

Specified by:
getSchedulingParameters in interface Schedulable
Returns:
a SchedulingParameters value

setSchedulingParameters

public void setSchedulingParameters(SchedulingParameters schedulingParam)
Set the SchedulingParameters for this schedulable object only if the resulting task set is feasible.

Specified by:
setSchedulingParameters in interface Schedulable
Parameters:
schedulingParam - a SchedulingParameters value

setSchedulingParametersIfFeasible

public boolean setSchedulingParametersIfFeasible(SchedulingParameters schedulingParam)
Set the SchedulingParameters for this schedulable object.

Specified by:
setSchedulingParametersIfFeasible in interface Schedulable
Parameters:
schedulingParam - a SchedulingParameters value
Returns:
true if the change was feasible, false otherwise.

removeFromFeasibility

public boolean removeFromFeasibility()
Inform the scheduler and cooperating facilities that the resource demands, as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of this instance of Schedulable should no longer be considered in the feasibility analysis of the associated Scheduler. Whether the resulting system is feasible or not, the subtrac-tion is completed.

Specified by:
removeFromFeasibility in interface Schedulable
Returns:
true If the resulting system is feasible.

sleep

public static void sleep(Clock clock,
                         HighResolutionTime time)
                  throws InterruptedException
Deprecated. Use the approriate method i.e. the one that has either RelativeTime or AbsoluteTime.

An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The sleep time may be relative or absolute. If relative, then the calling thread is blocked for the amount of time given by the parameter. If absolute, then the calling thread is blocked until the indicated point in time. If the given absolute time is before the current time, the call to sleep returns immediately.
Implementor Note: This method is ugly since it allows the application writer to pass a RationalTime, which does not make sense in this case.

Parameters:
clock - a Clock value
time - a HighResolutionTime value
Throws:
InterruptedException

sleep

public static void sleep(Clock clock,
                         RelativeTime time)
                  throws InterruptedException
An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The sleep time may be relative or absolute. If relative, then the calling thread is blocked for the amount of time given by the parameter. If absolute, then the calling thread is blocked until the indicated point in time. If the given absolute time is before the current time, the call to sleep returns immediately.

Parameters:
clock - a Clock value
time - a RelativeTime value
Throws:
InterruptedException

sleep

public static void sleep(Clock clock,
                         AbsoluteTime time)
                  throws InterruptedException
An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The sleep time may be relative or absolute. If relative, then the calling thread is blocked for the amount of time given by the parameter. If absolute, then the calling thread is blocked until the indicated point in time. If the given absolute time is before the current time, the call to sleep returns immediately.

Parameters:
clock - a Clock value
time - a AbsoluteTime value
Throws:
InterruptedException

sleep

public static void sleep(RelativeTime time)
                  throws InterruptedException
An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The calling thread is blocked for the amount of time given by the parameter.

Parameters:
time - a RelativeTime value
Throws:
InterruptedException

sleep

public static void sleep(AbsoluteTime time)
                  throws InterruptedException
An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The calling thread is blocked until the indicated point in time. If the given absolute time is before the current time, the call to sleep returns immediately.

Parameters:
time - an AbsoluteTime value
Throws:
InterruptedException

sleep

public static void sleep(HighResolutionTime time)
                  throws InterruptedException
An accurate timer with nanosecond granularity. The actual resolution available for the clock must be queried from somewhere else. The time base is the given Clock. The sleep time may be relative or absolute. If relative, then the calling thread is blocked for the amount of time given by the parameter. If absolute, then the calling thread is blocked until the indicated point in time. If the given absolute time is before the current time, the call to sleep returns immediately.
Implementor Note: This method is ugly since it allows the application writer to pass a RationalTime, which does not make sense in this case.

Parameters:
time - a HighResolutionTime value
Throws:
InterruptedException

start

public void start()
Checks if the instance of RealtimeThread is startable and starts it if it is.


run

public void run()
Specified by:
run in interface Runnable

rtfini_

protected void rtfini_()

waitForNextPeriod

public boolean waitForNextPeriod()
                          throws IllegalThreadStateException
Used by threads that have a reference to a ReleaseParameters type of PeriodicParameters to block until the start of each period. Periods start at either the start time in PeriodicParameters or when this.start() is called. This method will block until the start of the next period unless the thread is in either an overrun or deadline miss condition. If both overrun and miss handlers are null and the thread has overrun its cost or missed a deadline public boolean waitForNextPeriod() throws IllegalThreadStateException will immediately return false once per overrun or deadline miss. It will then again block until the start of the next period (unless, of course, the thread has overrun or missed again). If either the overrun or deadline miss handlers are not null and the thread is in either an overrun or deadline miss condition public boolean waitForNextPeriod() throws IllegalThreadStateException will block until the handler corrects the situation (possibly by calling public void schedulePeriodic() ).

Returns:
a boolean value
Throws:
IllegalThreadStateException - if this does not have a reference to a ReleaseParameters type of PeriodicParameters.

validateSchedulingParameters

protected boolean validateSchedulingParameters()

setupTSS

public void setupTSS()

getActiveMemoryArea

public MemoryArea getActiveMemoryArea()

getOuterMemoryArea_

protected MemoryArea getOuterMemoryArea_(int index)

getInitialMemoryAreaIndex_

protected int getInitialMemoryAreaIndex_()

getMemoryAreaStackDepth_

public int getMemoryAreaStackDepth_()

executionEligibility

public int executionEligibility()
Description copied from interface: Schedulable
NOTE: This method is not part of the RTSJ Specification. It is used internally by this RTSJ implementation.

Specified by:
executionEligibility in interface Schedulable
Returns:
an int value used internally to represent a total ordering of the schedulable entities.

setTopMemoryArea

protected boolean setTopMemoryArea(MemoryArea memoryArea)

getScopeStack

protected gnu.gcj.RawData getScopeStack()

yield

public static void yield()

setupTimeoutHandler

protected void setupTimeoutHandler()

updatePeriodicParameters

protected void updatePeriodicParameters()


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2005 Angelo Corsaro and Morgan Deters.