diff options
author | Martin Mares <mj@ucw.cz> | 1999-02-11 22:18:26 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-02-11 22:18:26 +0100 |
commit | e8f73195fa68b027fdcb89f239107c2d4902bd9a (patch) | |
tree | 8e3bb3ee7280eec6d78ae30d44738ddf2884c4fe /lib | |
parent | edf62ba13fa6a74447d7ad44b23acbee964731bc (diff) | |
download | bird-e8f73195fa68b027fdcb89f239107c2d4902bd9a.tar bird-e8f73195fa68b027fdcb89f239107c2d4902bd9a.zip |
Added simple event scheduling system to avoid recursive calling
of various callbacks.
Events are just another resource type objects (thus automatically freed
and unlinked when the protocol using them shuts down). Each event can
be linked in at most one event list. For most purposes, just use the
global event list handled by the following functions:
ev_schedule Schedule event to be called at the next event
scheduling point. If the event was already
scheduled, it's just re-linked to the end of the list.
ev_postpone Postpone an already scheduled event, so that it
won't get called. Postponed events can be scheduled
again by ev_schedule().
You can also create custom event lists to build your own synchronization
primitives. Just use:
ev_init_list to initialize an event list
ev_enqueue to schedule event on specified event list
ev_postpone works as well for custom lists
ev_run_list to run all events on your custom list
ev_run to run a specific event and dequeue it
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Modules | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Modules b/lib/Modules index b347aa2..19a7900 100644 --- a/lib/Modules +++ b/lib/Modules @@ -25,3 +25,5 @@ string.h patmatch.c slists.c slists.h +event.c +event.h |