Motr
M0
|
#include <chan.h>
Data Fields | |
struct m0_chan * | cl_chan |
m0_chan_cb_t | cl_cb |
struct m0_clink * | cl_group |
struct m0_tlink | cl_linkage |
struct m0_semaphore | cl_wait |
bool | cl_is_oneshot |
uint64_t | cl_magic |
A record of interest in events on a stream.
A clink records the appearance of events in the stream.
There are two ways to use a clink:
See the "Filtered wake-ups" section in the top-level comment on how to combine call-backs with waiting.
Concurrency control
A user must guarantee that at most one thread waits on a clink. Synchronization between call-backs, waits and clink destruction is also up to user.
A user owns a clink before call to m0_clink_add() and after return from the m0_clink_del() call. At any other time clink can be concurrently accessed by the implementation.
Liveness
A user is free to dispose a clink whenever it owns the latter.
m0_chan_cb_t cl_cb |
struct m0_chan* cl_chan |
struct m0_tlink cl_linkage |
Linkage into m0_chan::ch_links
struct m0_semaphore cl_wait |