Skip to main content

Module thread

Module thread 

Source
Expand description

World threads and their pacing. World threads: one thread owning one World, with pacing and stop control.

Re-exportsΒ§

use core::time::Duration; πŸ”’
use std::panic::AssertUnwindSafe; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Condvar; πŸ”’
use std::sync::Mutex; πŸ”’
use std::thread::JoinHandle; πŸ”’
use unlit_ecs::World; πŸ”’
use unlit_ecs::sync; πŸ”’
use web_time::Instant; πŸ”’
use crate::channel::Snapshot; πŸ”’
use crate::channel::SnapshotReader; πŸ”’
use crate::executor::LocalTasks; πŸ”’

StructsΒ§

FixedClock
Paces a fixed-rate loop: sleeps until the next step boundary.
Stop πŸ”’
The stop signal a thread and its owner share.
StopState πŸ”’
What a stop signal has been told, and what it can tell.
ThreadControl
How a world’s tick paces itself and observes a stop.
ThreadStatus πŸ”’
A cloneable view of a world’s state.
WorldThread
One thread owning one World.

EnumsΒ§

WorldState
What a spawned world is doing.

ConstantsΒ§

MAX_CATCH_UP_STEPS
The most fixed steps one tick may run to catch up with the time that passed.
STOP_TIMEOUT πŸ”’
How long a dropped thread waits for its tick to notice the stop before it is left detached instead of blocking the dropper.

FunctionsΒ§

fixed_steps
Turn elapsed time into a whole number of fixed steps, carrying the rest into the next tick as debt.
panic_message πŸ”’
The message a panic payload carries, whatever shape it arrived in.
stepped_control πŸ”’
A control and status pair for a world the host steps.