FrameThreadBridge
final class FrameThreadBridge
Implements: IThreadBridge
Package: dev.joid.lib.bridge.thread · Module: core · Source: FrameThreadBridge.java
The default thread bridge of a backend, for which the thread that creates it draws while other threads queue their tasks.
Description
Section titled “Description”Backend.register creates it on the thread that registers the backend.
UIBridgeRegistry.frame calls runTasks() at the start of every frame.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| FrameThreadBridge() | Creates the bridge and makes the calling thread the render thread. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
boolean | isRenderThread() | If true, the calling thread is the thread that created the bridge. |
void | execute(Runnable runnable) | Runs the task at once on the render thread; from another thread, queues it for the next runTasks(). |
void | runTasks() | Runs the queued tasks in order, including the tasks queued while it runs. |
Creation details
Section titled “Creation details”FrameThreadBridge
Section titled “FrameThreadBridge”FrameThreadBridge()
Creates the bridge and makes the calling thread the render thread.
Method details
Section titled “Method details”isRenderThread
Section titled “isRenderThread”boolean isRenderThread()
If true, the calling thread is the thread that created the bridge.
execute
Section titled “execute”void execute(Runnable runnable)
Runs the task at once on the render thread; from another thread, queues it for the next runTasks().
runTasks
Section titled “runTasks”void runTasks()
Runs the queued tasks in order, including the tasks queued while it runs.
Called from another thread than the one that created the bridge, it warns once.
A task that throws a RuntimeException prints one warning per kind of failure, and the next tasks still run.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
