Commit Graph

259 Commits

Author SHA1 Message Date
Max Kellermann
6c67408944 event/Loop: add flag alive
This replaces the old `dead` flag which was unreliable; it was `false`
if the EventThread was not yet started, which could cause deadlocks in
BlockingCall().
2019-02-05 22:38:45 +01:00
Jacob Vosmaer
66f5b0fed7 Add boost_dep in subdir meson.build files 2018-12-09 17:20:47 +01:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
a8bf8ede01 event/Thread: reduce the RTIO timer slack to 10us
MPD's default is 100ms, which is too long for the real-time I/O
thread.  The OutputThread has 100us, but the real-time I/O thread
might have tighter deadlines.

This change has currently no effect (I believe), because nobody uses
timers on the RTIO thread.
2018-11-14 12:11:57 +01:00
Max Kellermann
ba5c856f15 events/MultiSocketMonitor: add method ForEachResult() 2018-11-11 12:37:28 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
64da9399ca event/ServerSocket: allow mixing AddFD() with other Add*() methods 2018-10-30 22:14:53 +01:00
Max Kellermann
a943f4063c event/ServerSocket: add AddFD() overload with AllocatedSocketAddress&& 2018-10-30 20:44:56 +01:00
Max Kellermann
ce9f09c69a event/ServerSocket: make AddAddress() a template 2018-10-30 20:43:52 +01:00
Max Kellermann
3ddc7a5353 event/ServerSocket: include cleanup 2018-10-30 20:19:07 +01:00
Max Kellermann
e575392b94 event/ServerSocket: use class IPv6Address 2018-10-30 20:19:04 +01:00
Max Kellermann
c6f61a699c event/ServerSocket: make OneServerSocket an inner class 2018-10-30 20:16:26 +01:00
Max Kellermann
0307b49f43 event/ServerSocket: make OnAccept() noexcept 2018-10-30 20:13:07 +01:00
Max Kellermann
413ab80295 event/ServerSocket: use C++11 initializer 2018-10-30 20:11:58 +01:00
Max Kellermann
daffefdb10 event/ServerSocket: pass UniqueSocketDescriptor to AddFD() 2018-10-30 20:05:57 +01:00
Max Kellermann
5fb21fbdb1 event/ServerSocket: add noexcept 2018-10-30 19:57:39 +01:00
Max Kellermann
94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
dd461400fb system/EPollFD: rename to EpollFD 2018-08-22 15:40:45 +02:00
Max Kellermann
4a1e885c0a net/Resolver: replace with more advanced implementation
The new implementation is copied from another project and is
BSD-licensed.  It is exception-safe and can parse IPv6 scope ids with
interface names.
2018-08-21 08:26:12 +02:00
Max Kellermann
ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
1848
4797357fa9 fixed setting unix socket permissions
first call fchmod() to prevent TOCTTOU, then apply permissions using
chmod()
2018-08-14 22:53:19 +02:00
Max Kellermann
c1b33533da event/ServerSocket: fix get_remote_uid() call
This call was broken since commit
9a5bcc6db0 because the
`UniqueSocketDescriptor` had already been moved.
2018-08-09 13:22:25 +02:00
1848
737267cedc Moved call to fchmod() on socket from OneServerSocket::Open() to socket_bind_listen() 2018-08-07 22:01:13 +02:00
1848
84054203af Use fchmod instead of chmod for unix sockets to prevent TOCTTOU 2018-08-07 21:30:25 +02:00
Max Kellermann
7df0d3b7fc event/SignalMonitor: make SignalMonitorFinish() noexcept 2018-08-06 12:01:46 +02:00
Max Kellermann
fdd101c4c5 event/SignalMonitor: add noexcept 2018-08-06 12:00:49 +02:00
Max Kellermann
dd18fe34a7 system/SignalFD: throw exception on error 2018-08-06 11:58:29 +02:00
Max Kellermann
0c1a001622 system/Event{FD,Pipe}: throw exception on error 2018-08-06 11:49:38 +02:00
Max Kellermann
56bfff5a57 event/ServerSocket: add method IsEmpty() 2018-07-15 21:35:35 +02:00
Max Kellermann
d29d186d62 output/alsa: use a new I/O thread with real-time scheduling
The normal I/O event thread can have a large latency, e.g. when
libgnutls loads all TLS CA certificates for a https connect.  This
makes it unreliable for the ALSA I/O notifications, and causes ring
buffer xruns.  To avoid interfering with high latency events such as
CURL's, we move the ALSA I/O events to a separate I/O thread which
also obtains real-time scheduling (if possible).

Closes #221
2018-02-16 22:38:55 +01:00
Max Kellermann
19af364400 event/Thread: add "noexcept" 2018-01-29 23:11:15 +01:00
Max Kellermann
3fd9a86f3c event/Call: invoke function directly if the EventLoop is dead
Works around a deadlock bug which happens when waiting for an
EventLoop which isn't running anymore.
2018-01-29 23:06:43 +01:00
Max Kellermann
ce68701c0c event/Loop: add flag "dead" 2018-01-29 22:52:13 +01:00
Max Kellermann
6ea2cb3644 event/Thread: remove unused method StopAsync() 2018-01-29 22:50:21 +01:00
Max Kellermann
199c8aaa25 event/Loop: move code to HandleTimers() 2018-01-29 22:40:12 +01:00
Max Kellermann
3890bc5a96 event/Loop: add "noexcept" 2018-01-29 22:05:58 +01:00
Max Kellermann
2c65f986d6 event/EPoll: use C++11 initializer 2018-01-29 22:05:13 +01:00
Max Kellermann
ea402b765c event/WinSelect: pass const reference to copy constructor 2018-01-29 22:05:13 +01:00
Max Kellermann
497e0669ff event/PollResult: use size_t for size and index 2018-01-29 21:56:12 +01:00
Max Kellermann
bbc5212436 fs/AllocatedPath: make the nullptr_t constructor public 2018-01-17 12:17:41 +01:00
Max Kellermann
f8bb66b4e0 event/Loop: use std::atomic_bool for the "quit" variable
Fixes thread sanitizer warnings.
2017-12-22 11:04:24 +01:00
Max Kellermann
36899dba0b event/Call: document exceptions 2017-12-20 10:50:36 +01:00
Max Kellermann
6a31446671 event/TimerEvent: add "noexcept" 2017-12-20 10:45:30 +01:00
Max Kellermann
451fbbcea1 event/FullyBufferedSocket: add "noexcept" 2017-12-20 10:44:47 +01:00
Max Kellermann
a17a481e30 event/BufferedSocket: add "noexcept" 2017-12-20 10:42:17 +01:00
Max Kellermann
914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01:00
Max Kellermann
6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann
dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann
c582a9faae event/MultiSocketMonitor: add "noexcept" 2017-11-12 17:42:50 +01:00
Max Kellermann
cf483107c9 event/IdleMonitor: add "noexcept" 2017-11-12 17:40:25 +01:00