MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
wake.h File Reference

Go to the source code of this file.

Data Structures

struct  mln_wake

Typedefs

typedef void(*) mln_wake_callback(void *user_data)
typedef struct mln_wake mln_wake

Detailed Description

Public C API declarations for receiver wake callbacks.

Typedef Documentation

◆ mln_wake

typedef struct mln_wake mln_wake

Receiver wake callback copied by a successful owning call. The callback schedules service by the receiver and returns without waiting for another thread.

Native code may invoke callback from any thread, and calls may coalesce or overlap. The callback must not wait for another thread, directly or through a host lock that the other thread holds while it calls this library.

A callback may call the owner's functions that return without waiting, such as one that drains its queue. On the graphics thread, a callback may also service its own caller-driver session inline. A service of that session that already runs further up the stack returns MLN_STATUS_BUSY, and the running service takes the new work. When several sessions share a graphics thread, the host schedules service after the callback returns to keep calls from nesting across sessions.

The callback may release a delivery queue that owns its wake. For every other owner, the callback must not destroy the object that owns the wake. Native code calls release_user_data after all callback invocations have returned. It may run on any thread that invoked callback and must not wait for another thread.

A descriptor whose callback is null disables waking, and a disabled wake must not carry release_user_data. When the owning API permits a disabled wake, the receiver services its queue or driver on its own schedule instead.

◆ mln_wake_callback

typedef void(*) mln_wake_callback(void *user_data)

Schedules service by the receiver that owns a queue or driver.