1
.\" This man page is Copyright (C) 2010 Lennert Buytenhek.
2
.\" Permission is granted to distribute possibly modified copies
3
.\" of this page provided the header is included verbatim,
4
.\" and in case of nontrivial modification author and date
5
.\" of the modification is added to the header.
6
.TH iv_event 3 2010-09-03 "ivykis" "ivykis programmer's manual"
8
IV_EVENT_INIT, iv_event_register, iv_event_unregister, iv_event_post \- manage ivykis objects for event notification
10
.B #include <iv_event.h>
15
void (*handler)(void *);
19
.BI "int IV_EVENT_INIT(struct iv_event *" this ");"
21
.BI "int iv_event_register(struct iv_event *" this ");"
23
.BI "void iv_event_unregister(struct iv_event *" this ");"
25
.BI "void iv_event_post(struct iv_event *" this ");"
29
provides a way for delivering events to
31
recipients across thread boundaries.
33
The intended event recipient calls
45
To generate an event, call
47
on the previously initialized
49
object. This will cause the callback specified by
51
to be called in the thread that the
53
object was registered in, with
60
.B iv_event_unregister
61
from the same thread that
63
was called from on that object.
65
It is permitted to unregister a
67
object from any ivykis callback function in the thread it was
68
registered in, including from a callback function triggered by this
69
object, and it is permitted to free the memory corresponding to an
70
unregistered object from its own callback function.
73
can be called from the same thread that
75
was called from, or from a different thread within the same process,
76
but can not be called from a different process, and can not be called
77
from signal handlers. If you need this functionality, look at
82
is implemented as a wrapper around
84
and multiplexes multiple
86
objects over per-thread
87
.B struct iv_event_raw
88
objects, to save file descriptors and kernel resources.