com.threerings.media
Class FrameManager.Ticker

java.lang.Object
  extended by java.lang.Thread
      extended by com.threerings.media.FrameManager.Ticker
All Implemented Interfaces:
Runnable
Enclosing class:
FrameManager

protected class FrameManager.Ticker
extends Thread

Used to effect periodic calls to FrameManager.tick(long).


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  Runnable _awtTicker
          Used to invoke the call to FrameManager.tick(long) on the AWT event queue thread.
protected  long _lastAttempt
          The time at which we last attempted to tick.
protected  long _lastTick
          Used to compute metrics.
protected  boolean _running
          Used to stick a fork in our ticker when desired.
protected  boolean _ticking
          Used to detect when we need to drop frames.
protected  int _ticks
          Used to compute metrics.
protected  int _time
          Used to compute metrics.
protected  int _tries
          Used to compute metrics.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FrameManager.Ticker()
           
 
Method Summary
 void cancel()
           
protected  void clearTicking(long elapsed)
           
 void run()
           
protected  boolean testAndSet()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_awtTicker

protected Runnable _awtTicker
Used to invoke the call to FrameManager.tick(long) on the AWT event queue thread.


_running

protected transient boolean _running
Used to stick a fork in our ticker when desired.


_ticking

protected boolean _ticking
Used to detect when we need to drop frames.


_lastAttempt

protected long _lastAttempt
The time at which we last attempted to tick.


_tries

protected int _tries
Used to compute metrics.


_ticks

protected int _ticks
Used to compute metrics.


_time

protected int _time
Used to compute metrics.


_lastTick

protected long _lastTick
Used to compute metrics.

Constructor Detail

FrameManager.Ticker

public FrameManager.Ticker()
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

cancel

public void cancel()

testAndSet

protected final boolean testAndSet()

clearTicking

protected final void clearTicking(long elapsed)