aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/Loop.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-02-05event/Loop: remove the dummy constructor argumentMax Kellermann1-1/+1
2014-01-13copyright year 2014Max Kellermann1-1/+1
2014-01-09event/Loop: allow AddTimer() after Run() has returnedMax Kellermann1-1/+3
Kludge for libavahi-client quirk.
2014-01-09event/Loop: allow scheduling events before Run()Max Kellermann1-4/+13
Add the debug-only flag "virgin" which gets checked by assert() calls. Fixes assertion failures when using zeroconf/avahi.
2014-01-06event/Loop: cancel the WakeFD monitor in destructorMax Kellermann1-0/+4
2014-01-06event/SocketMonitor: don't close the socket automaticallyMax Kellermann1-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.
2014-01-05event/Loop: try to avoid the WakeFD when adding DeferredMonitorMax Kellermann1-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.
2014-01-05event/Loop: combine multiple WakeFD::Write() callsMax Kellermann1-1/+6
Reduce DeferredMonitor overhead.
2014-01-05event/Loop: add attribute "again"Max Kellermann1-2/+4
Improved support for added events.
2014-01-05event/Loop: add thread-safety assertionsMax Kellermann1-0/+16
2014-01-05event/Loop: remove obsolete assertionMax Kellermann1-2/+0
2014-01-05event/Loop: move code to HandleDeferred()Max Kellermann1-8/+12
2014-01-04event/Loop: remove the GLib implementationMax Kellermann1-48/+0
Now that the remaining known bugs in poll() implementation are fixed, we can go on without the GLib implementation.
2014-01-04event/Loop: remove bogus "!quit" assertionMax Kellermann1-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.
2014-01-04event/Loop: remove unused method AddCall()Max Kellermann1-19/+0
2014-01-04event/Loop: non-recursive Break() implementationMax Kellermann1-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.
2014-01-04event/DeferredMonitor: make fully thread-safeMax Kellermann1-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().
2013-11-28event: introduce generic API for internal event loopDenis Krjuchkov1-27/+14
2013-11-27Add infrastructure for using multiple event loopsDenis Krjuchkov1-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.
2013-11-06event/SocketMonitor: add method Abandon()Max Kellermann1-2/+7
2013-10-28*: use nullptr instead of NULLMax Kellermann1-1/+1
2013-10-15system/clock: convert to C++Max Kellermann1-4/+4
2013-08-10EventLoop: initialise the thread id explicitlyMax Kellermann1-1/+2
2013-08-10EventLoop: new implementation using epollMax Kellermann1-0/+196
Implement an event loop without GLib.
2013-08-10thread/Id: new class replacing GThread pointersMax Kellermann1-3/+3
Remove a GLib dependencies from class EventLoop and DatabaseLock.
2013-08-08EventLoop: add methodd IsInside()Max Kellermann1-0/+5
Track which thread runs the EventLoop and provide a check whether we're currently inside.
2013-08-08EventLoop: un-inline Run() and othersMax Kellermann1-21/+23
Prepare for adding more code.
2013-08-07event/DeferredMonitor: rename Run() to RunDeferred()Max Kellermann1-2/+2
2013-08-07event/DeferredMonitor: use EventLoop::AddIdle()Max Kellermann1-1/+1
2013-08-07event/DeferredMonitor: new class wrapping g_idle_add()Max Kellermann1-22/+16
2013-04-08event/TimeoutMonitor: eliminate support for periodic eventsMax Kellermann1-9/+5
No caller needs this. Fixes use-after-free after returning from Client::OnTimeout().
2013-01-14event/TimeoutMonitor: wrapper for g_timeout_source_new()Max Kellermann1-23/+31
2013-01-03Client: rename the struct client to class ClientMax Kellermann1-3/+3
2013-01-03client: convert to C++Max Kellermann1-3/+3
2012-02-14command: move functions to protocol/result.cMax Kellermann1-14/+30
2012-02-12update_remove: add header update_remove.hMax Kellermann1-9/+13
2012-02-12playlist/embcue: new plugin for reading embedded cue sheetsMax Kellermann1-11/+8
Parses CUE data from the "CUESHEET" tag. Needs further integration in the update thread.
2012-02-11decoder_plugin: scan tags with callback tableMax Kellermann1-0/+5
Pass a callback table to scan_file() and scan_stream(), instead of returning a tag object.
2012-02-11decoder/vorbis: move code to vorbis_comment.cMax Kellermann1-4/+7
2011-01-29copyright year 2011Max Kellermann1-1/+1
2010-11-18replay_gain_ape: parse replay gain from APE tagsMax Kellermann1-7/+5
Based on the APE reader.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-09-24listen: handle fatal errors with GErrorMax Kellermann1-1/+6
Don't call g_error(), which will abort the process and dump core.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+7
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-02-24listen: no CamelCaseMax Kellermann1-3/+3
Renamed functions.
2008-12-30main: use the GLib main loopMax Kellermann1-7/+0
This is a rather huge patch, which unfortunately cannot be splitted. Instead of using our custom ioops.h library, convert everything to use the GLib main loop.
2008-12-30listen: eliminated freeAllListenSockets()Max Kellermann1-1/+0
Merged freeAllListenSockets() into closeAllListenSockets(), because this is its only caller.
2008-10-31added prefix to header macrosMax Kellermann1-2/+2
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is ffmpeg's fault, because short macros should be reserved for applications, but since it's always a good idea to choose prefixed macro names, even for applications, we are going to do that in MPD.
2008-10-08don't include os_compat.hMax Kellermann1-1/+1
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-04-12clean up CPP includesMax Kellermann1-1/+0
Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f