aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/Loop.cxx (follow)
Commit message (Collapse)AuthorAgeFilesLines
* event/Loop: allow AddTimer() after Run() has returnedMax Kellermann2014-01-091-1/+3
| | | | Kludge for libavahi-client quirk.
* event/Loop: allow scheduling events before Run()Max Kellermann2014-01-091-4/+13
| | | | | Add the debug-only flag "virgin" which gets checked by assert() calls. Fixes assertion failures when using zeroconf/avahi.
* event/Loop: cancel the WakeFD monitor in destructorMax Kellermann2014-01-061-0/+4
|
* event/SocketMonitor: don't close the socket automaticallyMax Kellermann2014-01-061-3/+0
| | | | | | Users now have to call Close() explicitly. This simplifies using the class, as most users have automatic socket management already, and Steal() had to be used often.
* event/Loop: try to avoid the WakeFD when adding DeferredMonitorMax Kellermann2014-01-051-2/+16
| | | | | | | | | Add a flag that indicates whether the EventLoop is currently "busy". As long as that flag is set, it does not need to be woken up - we can simply add the DeferredMonitor to the list, and it will be caught by EventLoop very soon. This eliminates nearly all of the DeferredMonitor overhead when compared to IdleMonitor, rendering IdleMonitor mostly obsolete.
* event/Loop: combine multiple WakeFD::Write() callsMax Kellermann2014-01-051-1/+6
| | | | Reduce DeferredMonitor overhead.
* event/Loop: add attribute "again"Max Kellermann2014-01-051-2/+4
| | | | Improved support for added events.
* event/Loop: add thread-safety assertionsMax Kellermann2014-01-051-0/+16
|
* event/Loop: remove obsolete assertionMax Kellermann2014-01-051-2/+0
|
* event/Loop: move code to HandleDeferred()Max Kellermann2014-01-051-8/+12
|
* event/Loop: remove the GLib implementationMax Kellermann2014-01-041-48/+0
| | | | | Now that the remaining known bugs in poll() implementation are fixed, we can go on without the GLib implementation.
* event/Loop: remove bogus "!quit" assertionMax Kellermann2014-01-041-5/+3
| | | | | | | Commit 1f11959 allowed modifying the "quit" attribute from any thread, and thus the assertion may fail spuriously. This assertion is too strict for the relaxed use of "quit". Let's remove it and move the "quit" check to before the SockedMonitor::Dispatch() call.
* event/Loop: remove unused method AddCall()Max Kellermann2014-01-041-19/+0
|
* event/Loop: non-recursive Break() implementationMax Kellermann2014-01-041-4/+2
| | | | | | Simply set the "quit" flag and wake up the thread. This works even if we're inside this thread. Setting "quit" to a new value without mutex protection is usually not safe, but good enough here.
* event/DeferredMonitor: make fully thread-safeMax Kellermann2014-01-041-0/+51
| | | | | | | | | | | | | Instead of creating a new eventfd for each DeferredMonitor instance, reuse EventLoop's eventfd, and add a std::list to EventLoop that manages the list of pending DeferredMonitors. This std::list is protected by the same mutex as the "calls" list. The bottom line is: reduced overhead because the per-instance eventfd was eliminated, slightly added overhead due to Mutex usage (but negligible), and we're thread-safe now. This subsystem is now good enough to replace EventLoop::AddCall().
* event: introduce generic API for internal event loopDenis Krjuchkov2013-11-281-27/+14
|
* Add infrastructure for using multiple event loopsDenis Krjuchkov2013-11-271-5/+18
| | | | | | | | | | | | This change adds two configuration options: --with-eventloop=[glib|internal|auto] --with-pollmethod=[epoll|auto] First allows switching between GLib event loop and internal one. Second chooses backend to use for internal event loop. Conditional compilation symbols are changed accordingly. Additional helper macro MPD_OPTIONAL_FUNC_NODEF is added as well.
* event/SocketMonitor: add method Abandon()Max Kellermann2013-11-061-2/+7
|
* *: use nullptr instead of NULLMax Kellermann2013-10-281-1/+1
|
* system/clock: convert to C++Max Kellermann2013-10-151-4/+4
|
* EventLoop: initialise the thread id explicitlyMax Kellermann2013-08-101-1/+2
|
* EventLoop: new implementation using epollMax Kellermann2013-08-101-0/+196
| | | | Implement an event loop without GLib.
* thread/Id: new class replacing GThread pointersMax Kellermann2013-08-101-3/+3
| | | | Remove a GLib dependencies from class EventLoop and DatabaseLock.
* EventLoop: add methodd IsInside()Max Kellermann2013-08-081-0/+5
| | | | | Track which thread runs the EventLoop and provide a check whether we're currently inside.
* EventLoop: un-inline Run() and othersMax Kellermann2013-08-081-0/+57
Prepare for adding more code.