|
Monado OpenXR Runtime
|
Base timing source implementation. More...

Data Structures | |
| struct | b_timing_source |
Macros | |
| #define | B_TIMING_SOURCE_MAX_SINKS 4 |
Functions | |
| static struct b_timing_source * | from_source (struct t_timing_event_source *ttes) |
| t_timing_event_source implementation | |
| static int | b_timing_source_add_sink (struct t_timing_event_source *ttes, struct t_timing_event_sink *sink) |
| static void | b_timing_source_remove_sink (struct t_timing_event_source *ttes, struct t_timing_event_sink *sink) |
| static struct b_timing_source * | from_sink (struct t_timing_event_sink *sink) |
| t_timing_event_sink implementation | |
| static void | b_timing_source_push_timing_event (struct t_timing_event_sink *sink, const struct t_timing_event *event) |
Fan out event to every registered downstream sink. | |
| static struct b_timing_source * | from_node (struct xrt_frame_node *node) |
| xrt_frame_node implementation | |
| static void | b_timing_source_break_apart (struct xrt_frame_node *node) |
| static void | b_timing_source_destroy (struct xrt_frame_node *node) |
| xrt_result_t | b_timing_source_create (struct xrt_frame_context *xfctx, struct t_timing_event_sink **out_sink, struct t_timing_event_source **out_source) |
Base timing source implementation.
|
static |
Fan out event to every registered downstream sink.
The mutex must be held for the entire fan-out, including while calling each downstream push_timing_event. Timing sinks unregister themselves on destruction via remove_sink; without the lock held across the callbacks, a sink can be destroyed and freed on another thread while we still hold (or call through) its pointer. Clever alternatives like copying the sink list and unlocking before dispatch do not help: the copied pointers can still become use-after-free once the owning object is destroyed.
Because the mutex is non-recursive, downstream callbacks must not call add_sink / remove_sink on this same b_timing_source (that would deadlock). Sink registration is expected at setup / teardown time, not from inside event delivery.
References ARRAY_SIZE, from_sink(), and t_timing_event_sink::t_timing_event_sink_push_timing_event().
|
static |
xrt_frame_node implementation
References container_of.
|
static |
t_timing_event_sink implementation
References container_of.
Referenced by b_timing_source_push_timing_event().
|
static |
t_timing_event_source implementation
References container_of.