Commit Graph

5 Commits

Author SHA1 Message Date
Lucas De Marchi da65a5c349 AP_HAL_Linux: allow to wakeup pollable
This allows to wakeup the thread that is sleeping on Poller::poll()
[ which in our case is an epoll_wait() call ]. This is usually achieved
by using a special signal and using the pwait() variant of the sleeping
function (or using signalfd). However integrating the signal in the
Thread class is more complex than simply use the eventfd syscall which
can serve our needs.
2016-11-02 16:28:20 -02:00
Lucas De Marchi efe819e21e AP_HAL_Linux: Poller: allow to fail constructor 2016-11-02 16:28:20 -02:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Lucas De Marchi eca6f45b68 AP_HAL_Linux: remove unused part of Poller infra
We aren't going to use all the poller infra for now and we need it's
behavior a little bit different for what we are going to use:

    - Do not use any "fair" time for each ready fd since we don't want
      to set a timeout
    - Allow to set the fd on Pollable after constructing it since we are
      likely to embed Pollable inside other structs and just later be
      able to open an fd.
    - Let caller use the epoll flags directly - this is not in AP_HAL,
      so there's no need to abstract them
2016-07-30 00:55:27 -03:00
Leandro Pereira 0f865a019a AP_HAL_Linux: Add Pollable/Poller
Add system's polling infrastructure to be notified whenever a
file descriptor is ready to be read from or written to.

Adds a few classes:
  * Poller, as an interface to epoll()
  * Pollable, as an interface to a file descriptor
2016-07-30 00:55:27 -03:00