|
YAACC - UPNP Client and Server
|
The time source of the feed: a monotonic nanosecond clock and a sleep that goes with it. More...

Public Member Functions | |
| long | nanoTime () |
| A monotonic time in nanoseconds; only differences mean something. | |
| void | sleepNanos (long nanos) throws InterruptedException |
Waits until this clock has advanced by nanos; returns at once for zero or less. | |
| void | wake (Thread thread) |
Ends the sleep of thread early. | |
Public Attributes | |
| FeedClock | SYSTEM |
The real clock: System#nanoTime(), a sleep that ends early on an interrupt or a wake. | |
The time source of the feed: a monotonic nanosecond clock and a sleep that goes with it.
The real one is SYSTEM; a test passes a clock that it moves by hand, so that pacing needs no real waiting.
| void de.yaacc.multiroom.feed.FeedClock.sleepNanos | ( | long | nanos | ) | throws InterruptedException |
Waits until this clock has advanced by nanos; returns at once for zero or less.
May return early (after a wake, or spuriously): the caller looks at the situation again and sleeps again if it must.
| InterruptedException | when the thread is interrupted (the feeder does that to stop its writer) |
| void de.yaacc.multiroom.feed.FeedClock.wake | ( | Thread | thread | ) |
Ends the sleep of thread early.
If it does not sleep now, its next sleep returns at once (the permit of LockSupport.unpark). The feeder uses it to tell the writer that audio has arrived.
| FeedClock de.yaacc.multiroom.feed.FeedClock.SYSTEM |
The real clock: System#nanoTime(), a sleep that ends early on an interrupt or a wake.