Skip to content

ei: add ei_ping() and the matching EI_EVENT_PONG

Peter Hutterer requested to merge whot/libei:wip/ei-sync into main

This wraps around ei_connection.sync to allow a C API user to add synchronization points.

Basic use:

struct ei_ping *ping = ei_new_ping(ei);
ei_ping(ping);
... wait for EI_EVENT_TYPE_PONG ...
struct ei_pong *pong = ei_event_pong_get_ping(event);
assert(pong == ping);
ei_ping_unref(ping);

And the ei_ping has a user_data pointer to be set to whatever is wanted.

Closes #69 (closed)

cc @rkjnsn1

Merge request reports

Loading