aboutsummaryrefslogtreecommitdiffstats
path: root/src/event (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-01-04event/poll: eliminate one vector::size() callMax Kellermann1-2/+3
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 Kellermann2-28/+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/BlockingCall: always use DeferredMonitor internallyMax Kellermann1-24/+0
There is no advantage of using EventLoop::AddCall(), now that DeferredMonitor is thread-safe.
2014-01-04event/DeferredMonitor: make fully thread-safeMax Kellermann4-54/+77
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-12-31event/*Monitor: document as not being thread-safeMax Kellermann4-0/+15
2013-12-31event/Loop: document that AddCall() is thread-safeMax Kellermann1-0/+5
2013-12-21event/PollGroupPoll: include stddef.h instead of string.hMax Kellermann1-1/+2
2013-12-19util/fifo_buffer: remove obsolete libraryMax Kellermann1-1/+0
2013-12-19util/PeakBuffer: use IsEmpty() instead of IsNull()Max Kellermann1-1/+1
The DynamicFifoBuffer methods never return nullptr when the buffer is empty or full; instead, they return an empty buffer. This bug caused an endless loop.
2013-12-15util/PeakBuffer: use DynamicFifoBuffer instead of struct fifo_bufferMax Kellermann1-1/+0
Switch to the C++ version.
2013-12-15util/PeakBuffer: return ConstBuffer<void>Max Kellermann1-4/+3
2013-12-15configure.ac: add option "--disable-glib"Max Kellermann1-0/+1
Allows building without GLib. This fails to compile currently, because GLib is still used in the MPD core.
2013-12-04system/Resolver: sockaddr_to_string() returns std::string()Max Kellermann1-22/+11
No GLib memory allocation.
2013-12-03PollGroupWinSelect: delete copy constructor and assignment operatorDenis Krjuchkov1-0/+2
2013-12-03PollGroupWinSelect: uninline constructor and destructorDenis Krjuchkov2-2/+5
2013-12-02event: add poll() based PollGroup implementationDenis Krjuchkov3-0/+156
2013-11-29PollGroupEPoll.hxx: add const modifiers where applicableDenis Krjuchkov1-2/+2
2013-11-29event: implement PollGroup based on Windows selectDenis Krjuchkov4-0/+330
2013-11-28event: introduce generic API for internal event loopDenis Krjuchkov6-55/+147
2013-11-28include cleanup using iwyuMax Kellermann9-3/+11
2013-11-27Add infrastructure for using multiple event loopsDenis Krjuchkov13-113/+215
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-24event: add API documentationMax Kellermann5-1/+38
2013-11-24event/SocketMonitor: add missing spaceMax Kellermann2-4/+4
2013-11-06event/FullyBufferedSocket: remove obsolete TODO commentMax Kellermann1-16/+0
We have a better solution now.
2013-11-06event/FullyBufferedSocket: try to write without extra roundtripMax Kellermann2-17/+33
Postpone the write using IdleMonitor instead of scheduling a write event. This reduces the number of system calls, because we don't need to register and unregister the write event in epoll.
2013-11-06event/FullyBufferedSocket: make WriteFromBuffer() protectedMax Kellermann2-4/+4
.. and rename it to Flush().
2013-11-06event/SocketMonitor: add method Abandon()Max Kellermann4-2/+32
2013-11-04event/ServerSocket: don't abort if IPv6 is not availableMax Kellermann1-1/+19
First check if an IPv6 socket can be created.
2013-11-04event/ServerSocket: fix assertion failureMax Kellermann1-1/+1
Regression from previous commit. D'oh!
2013-11-04event/ServerSocket: open sockets in the order they were configuredMax Kellermann2-5/+5
Use a std::list which can be appended at the end.
2013-10-28*: use nullptr instead of NULLMax Kellermann2-4/+4
2013-10-19event/ServerSocket: pass AllocatedPath to AddPath()Max Kellermann2-14/+18
2013-10-18SignalMonitor: add SignalMonitorGetEventLoop()Max Kellermann2-0/+15
Eliminate the global variable "shutdown_loop".
2013-10-15event/BufferedSocket: pass writable pointer to OnSocketInput()Max Kellermann1-1/+9
Remove the const_cast from HttpdClient.cxx, and avoid one allocation in ClientRead.cxx.
2013-10-15util/FifoBuffer: C++ version of the fifo_buffer libraryMax Kellermann2-44/+21
2013-10-15system/clock: convert to C++Max Kellermann1-4/+4
2013-10-15require GLib 2.28Max Kellermann1-2/+0
The header glib_compat.h is now obsolete and can be removed.
2013-10-15gcc.h: rename to Compiler.hMax Kellermann8-8/+8
2013-10-02Log: new logging library APIMax Kellermann1-11/+12
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
2013-09-04system/SocketError: un-inline constructorMax Kellermann1-0/+2
Reduces header dependencies.
2013-09-04util/Error: new error passing libraryMax Kellermann5-54/+56
Replaces GLib's GError.
2013-09-04system/resolver: convert to C++Max Kellermann1-1/+1
2013-08-10EventLoop: initialise the thread id explicitlyMax Kellermann1-1/+2
2013-08-10EventLoop: new implementation using epollMax Kellermann13-16/+705
Implement an event loop without GLib.
2013-08-10event/Call: signal the calling threadMax Kellermann1-0/+5
Fixes regression from commit 018f4155.
2013-08-10event/IdleMonitor: new monitor classMax Kellermann2-0/+130
2013-08-10event/MultiSocketMonitor: add struct SingleFDMax Kellermann2-8/+32
Prepare for migrating away from GLib.
2013-08-10event/MultiSocketMonitor: use uint64_t instead of gint64Max Kellermann2-5/+6
Unsigned and portable.