Sarek_vulkan.Vulkan_api_eventmodule Device = Vulkan_api_devicemodule Stream = Vulkan_api_streamAn event is a tracked fence: pending from a successful record until a wait observes it signalled. An event that was never recorded, or whose record failed, is not pending, so synchronizing it returns at once. lock serializes the wait/reset/submit sequences on the fence across domains.
val destroy : t -> unitSignal event once all work launched on the device of stream before this call has completed: the open launch batches are submitted, then an empty submission carrying the event's fence follows them in the queue. A previous record still pending is waited for first, since a pending fence cannot be reset.
All later work of stream waits for the work event covers: the single queue plus the barrier before every dispatch order it in memory (see Vulkan_api_barrier); the host-side half is that synchronising stream also waits for the event (Vulkan_api_batch.synchronize).
val synchronize : t -> unitval query : t -> booltrue once the work covered by the last record has completed, or when the event was never recorded. Never blocks: a signalled fence is reaped (marked not pending) so a later record need not wait. While another domain holds the event's lock (it is recording or waiting), the work is still pending and the answer is false.