aboutsummaryrefslogtreecommitdiffstats
path: root/src/event (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Copyright year 2015Max Kellermann2015-01-0130-30/+30
|
* Merge branch 'v0.19.x'Max Kellermann2014-12-151-1/+2
|\
| * event/Loop: read the "again" flag while holding mutexMax Kellermann2014-12-141-1/+2
| |
* | playlist, InotifySource, ...: update GLib commentsMax Kellermann2014-12-041-1/+1
|/
* event/DeferredMonitor: include cleanupMax Kellermann2014-11-251-3/+0
|
* Merge tag 'v0.18.18' into v0.19.xMax Kellermann2014-11-181-1/+1
|\
| * event/ServerSocket: fix get_remote_uid() error valueMax Kellermann2014-11-181-1/+1
| | | | | | | | Must return -1 on error, not 0. 0 is root.
* | event/IdleMonitor: remove redundant commentMax Kellermann2014-10-101-2/+1
| |
* | Merge branch 'v0.18.x'Max Kellermann2014-08-241-1/+1
|\|
| * event/TimeoutMonitor: really reset "active" flag before invoking OnTimeout()Max Kellermann2014-08-241-1/+1
| | | | | | | | The previous commit was broken. D'oh!
* | Merge branch 'v0.18.x'Max Kellermann2014-08-241-0/+1
|\|
| * event/TimeoutMonitor: reset "active" flag before invoking OnTimeout()Max Kellermann2014-08-241-1/+3
| | | | | | | | | | | | The IsActive() method returned true even if the timer was not active, after it completed once. This broke the state file timer, and the state file was not saved periodically.
| * event/BufferedSocket: fix inversed buffer checkMax Kellermann2014-08-071-1/+1
| | | | | | | | | | This was broken by commit 84d20d9e, which deleted the "!" from the check.
| * DeferredMonitor: fix race condition when using GLib event loopMax Kellermann2014-04-262-11/+22
| | | | | | | | | | | | | | | | | | Turns out the lock-free code using atomics was not thread-safe. The given callback could be invoked by GLib before the source_id attribute was assigned. This commit changes the DeferredMonitor class to use a Mutex to block the event loop until source_id is assigned. This bug does not exist in the 0.19 branch because it does not use the GLib main loop anymore.
| * event/SignalMonitor: fix build failure due to missing signal.h includeMax Kellermann2014-03-021-0/+2
| |
* | event/BufferedSocket: fix inversed buffer checkMax Kellermann2014-08-071-1/+1
| | | | | | | | | | This was broken by commit 84d20d9e, which deleted the "!" from the check.
* | util/FifoBuffer: rename to StaticFifoBufferMax Kellermann2014-08-061-2/+2
| |
* | configure.ac: always define _GNU_SOURCE on LinuxMax Kellermann2014-03-151-5/+0
| | | | | | | | Make sure glibc gives us all features.
* | Merge branch 'v0.18.x'Max Kellermann2014-02-181-1/+22
|\|
| * event/SignalMonitor: unblock signals after forkMax Kellermann2014-02-181-1/+22
| | | | | | | | Fixes hanging child process in the "pipe" output plugin.
* | event/Loop: remove the dummy constructor argumentMax Kellermann2014-02-052-4/+2
| |
* | copyright year 2014Max Kellermann2014-01-1330-30/+30
| |
* | 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-093-5/+29
| | | | | | | | | | Add the debug-only flag "virgin" which gets checked by assert() calls. Fixes assertion failures when using zeroconf/avahi.
* | util/Alloc: new library replacing GLib's g_malloc()Max Kellermann2014-01-071-4/+3
| |
* | event/Loop: cancel the WakeFD monitor in destructorMax Kellermann2014-01-061-0/+4
| |
* | event/MultiSocketMonitor: add method ClearSocketList()Max Kellermann2014-01-062-0/+14
| |
* | event/SocketMonitor: don't close the socket automaticallyMax Kellermann2014-01-066-14/+8
| | | | | | | | | | | | 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/IdleMonitor: cancel in destructor only if activeMax Kellermann2014-01-061-1/+6
| | | | | | | | Debug-mode workaround for bogus assertion failure.
* | event/MultiSocketMonitor: API documentationMax Kellermann2014-01-061-0/+10
| |
* | event/Loop: try to avoid the WakeFD when adding DeferredMonitorMax Kellermann2014-01-052-2/+24
| | | | | | | | | | | | | | | | | | 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-052-2/+10
| | | | | | | | Improved support for added events.
* | event/Loop: add thread-safety assertionsMax Kellermann2014-01-053-1/+30
| |
* | event/Loop: remove obsolete assertionMax Kellermann2014-01-051-2/+0
| |
* | event/Loop: move code to HandleDeferred()Max Kellermann2014-01-052-8/+19
| |
* | event/MultiSocketMonitor: add missing <algorithm> includeMax Kellermann2014-01-051-0/+2
| | | | | | | | For std::find_if().
* | event/MultiSocketMonitor: add method ReplaceSocketList()Max Kellermann2014-01-052-0/+42
| | | | | | Move code from AlsaMixerPlugin.
* | event/MultiSocketMonitor: include cleanupMax Kellermann2014-01-052-8/+1
| |
* | event/Loop: remove the GLib implementationMax Kellermann2014-01-0412-664/+3
| | | | | | | | | | Now that the remaining known bugs in poll() implementation are fixed, we can go on without the GLib implementation.
* | event/poll: eliminate one vector::size() callMax Kellermann2014-01-041-2/+3
| |
* | 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-042-28/+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/BlockingCall: always use DeferredMonitor internallyMax Kellermann2014-01-041-24/+0
| | | | | | | | | | There is no advantage of using EventLoop::AddCall(), now that DeferredMonitor is thread-safe.
* | event/DeferredMonitor: make fully thread-safeMax Kellermann2014-01-044-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().
* | event/*Monitor: document as not being thread-safeMax Kellermann2013-12-314-0/+15
| |
* | event/Loop: document that AddCall() is thread-safeMax Kellermann2013-12-311-0/+5
| |
* | event/PollGroupPoll: include stddef.h instead of string.hMax Kellermann2013-12-211-1/+2
| |
* | util/fifo_buffer: remove obsolete libraryMax Kellermann2013-12-191-1/+0
| |