Commit Briefs

Omar Polo

ev: add note


Omar Polo

ev: fmt


Omar Polo

ev: check for fd dups


Omar Polo

ev: add signal() to catch signals safely too

Uses the 'self-pipe trick' to catch and process signals outside of the signal environment. A few XXX remains, but this is good enough to hit the tree.


Omar Polo

ev: move some functions to ev/global.ha

Move there functions that relies on the global event loop.


Omar Polo

ev: fmt


Omar Polo

ev: add loopbreak to the API


Omar Polo

ev: rework the API

Allow to create custom event loops, but still retain the possibility to just use a global one.


Omar Polo

ev: remove unnecessary check


Omar Polo

ev: inline use nullable *opaque instead of ev::any

ev::any was just to save some typing; not sure it's worth it. Can be easily confused with ev::READ and ev::WRITE.


Omar Polo

ev: use def instead of const for globals

I actually don't get the difference between def and const. maybe def is guaranteed to be a compile-time constant (just guessing). Other "#defines" in the hare stdlib seem to use def tho, so follow here too.


Omar Polo

ev: use two queues

avoids issues with adding/removing elements from the 'working' queue. ev::add and ev::del only touch the "wip" queue, while poll only touches the "working" queue. This technically has the consequences that if from event A we remove event B which is pending and not yet processed, we may still fire B once.


Omar Polo

ev: process all the events

This was intended as an optimization: poll returns the number of elements in the pollfd set which had events. Can be revised in the future.


Omar Polo

initial import