Class BoardRealtime

java.lang.Object
com.codename1.realtime.Realtime
com.codename1.backend.BoardRealtime

public final class BoardRealtime extends Realtime
The headless backend's Realtime: the same scheduler calls as the Linux port, through the same C (cn1_realtime_impl.h, wrapped in cn1_backend_realtime.c), so a gateway can run a control loop beside its REST API in one binary. Off Linux the collector isolation and the allocation check still apply; scheduling and memory locking answer -ENOSYS. Every primitive acts on the calling thread.
  • Method Details

    • install

      public static void install()
      Makes this the instance Realtime.getInstance() returns. The server calls it as it starts; calling it again does nothing.
    • getSupportedFeatures

      protected int getSupportedFeatures()
      Description copied from class: Realtime
      Bit mask of the FEATURE_ constants this platform provides. The default provides none.
      Overrides:
      getSupportedFeatures in class Realtime
    • rawEnter

      protected int rawEnter(RealtimeThread thread, int priority, int cpu, boolean isolate)
      Description copied from class: Realtime

      Makes the calling thread real-time.

      Returns

      the APPLIED_ bits for what took effect, or a negative errno

      Overrides:
      rawEnter in class Realtime
    • rawLeave

      protected void rawLeave(RealtimeThread thread)
      Description copied from class: Realtime
      Returns the calling thread to normal scheduling.
      Overrides:
      rawLeave in class Realtime
    • rawStartPeriod

      protected void rawStartPeriod(RealtimeThread thread, long periodNanos)
      Description copied from class: Realtime
      Starts the periodic clock on the calling thread; the first release is one period from now.
      Overrides:
      rawStartPeriod in class Realtime
    • rawWaitNextPeriod

      protected int rawWaitNextPeriod(RealtimeThread thread)
      Description copied from class: Realtime

      Sleeps the calling thread to its next release.

      Returns

      how many releases were missed

      Overrides:
      rawWaitNextPeriod in class Realtime
    • rawFreeze

      protected void rawFreeze(RealtimeThread thread, int budget, RealtimeAllocationError error)
      Description copied from class: Realtime
      Enters the steady state on the calling thread: from here an allocation beyond budget per period throws error. The default has no run-time check.
      Overrides:
      rawFreeze in class Realtime
    • rawThaw

      protected void rawThaw(RealtimeThread thread)
      Description copied from class: Realtime
      Leaves the steady state on the calling thread. Safe to call when not frozen.
      Overrides:
      rawThaw in class Realtime
    • rawStatistics

      protected void rawStatistics(RealtimeThread thread, long[] out)
      Description copied from class: Realtime
      Copies the calling thread's statistics into out (RealtimeStatistics.COUNT values).
      Overrides:
      rawStatistics in class Realtime
    • rawLastViolation

      protected String rawLastViolation(RealtimeThread thread)
      Description copied from class: Realtime
      The class of the allocation that ended the calling thread's last steady state, or null.
      Overrides:
      rawLastViolation in class Realtime
    • rawLockMemory

      protected int rawLockMemory()
      Description copied from class: Realtime
      Locks the process's memory. Returns 0 or a negative errno; the default answers -38 (ENOSYS).
      Overrides:
      rawLockMemory in class Realtime
    • rawSetMemoryLimit

      protected void rawSetMemoryLimit(long bytes, OutOfMemoryError error)
      Description copied from class: Realtime
      Installs the memory limit; error is the instance to throw. The default does nothing.
      Overrides:
      rawSetMemoryLimit in class Realtime