Commit Graph

256 Commits

Author SHA1 Message Date
Max Kellermann 593d82c6a9 event/DeferEvent: add "noexcept" 2017-11-10 20:55:24 +01:00
Max Kellermann 43dccbd45d event/SocketMonitor: remove unused method Abandon() 2017-11-10 20:52:37 +01:00
Max Kellermann 0ff4350352 event/ServerSocket: pass UniqueSocketDescriptor by value
Passing it by value is actually smaller (32 bit) than the rvalue
reference (64 bit pointer), and it ensures that the object is consumed
after the call returns, no matter how the methods are implemented.
2017-11-10 20:43:14 +01:00
Max Kellermann 5fd2b7cc79 event/SocketMonitor: eliminate Read(), Write()
Migrate callers to GetSocket().Read(), GetSocket.Write(), which is the
same.
2017-11-10 20:37:52 +01:00
Max Kellermann 7e16ac305d event/SocketMonitor: rename Get() to GetSocket() 2017-11-10 20:34:45 +01:00
Max Kellermann 59a8836924 event/SocketMonitor: add "noexcept" 2017-11-10 20:20:07 +01:00
Max Kellermann 9d4020501c event/SocketMonitor: make constructor "explicit" 2017-11-10 20:17:27 +01:00
Max Kellermann 81350d65bc event/SocketMonitor: use C++11 initializers 2017-11-10 20:16:26 +01:00
Max Kellermann 3c41e9f022 evnet/SocketMonitor: move WIN32/ERROR comment to PollGroupWinSelect.hxx 2017-11-10 19:57:54 +01:00
Max Kellermann 49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00
Max Kellermann 9df4853e23 event/DeferredCall: rename to DeferEvent 2017-09-21 22:40:25 +02:00
Max Kellermann 987c505906 event/TimeoutMonitor: remove obsolete class 2017-08-29 16:53:15 +02:00
Max Kellermann 7ae57a3531 event/MultiSocketMonitor: migrate from TimeoutMonitor to TimerEvent 2017-08-29 16:28:27 +02:00
Max Kellermann 30a5dd267b event/TimeoutMonitor: move code to new class TimerEvent 2017-08-29 16:28:27 +02:00
Max Kellermann 2f0d683378 event/Loop: fix inverted checkin RemoveDeferred() 2017-08-29 16:28:24 +02:00
Max Kellermann a1309a90ac event/Loop: use boost::intrusive::list to store IdleMonitors and DeferredMonitors
The intrusive contains can easily erase items without searching
through the whole list.  This removes a good amount of runtime
overhead.
2017-08-29 15:43:16 +02:00
Max Kellermann 010855a294 event/Loop: use boost::intrusive::multiset to store TimeoutMonitors
By using an "intrusive" data structure, we can easily eliminate
struct TimerRecord.
2017-08-29 14:42:59 +02:00
Max Kellermann 71ed3ff992 event/Loop: move TimerRecord::due to class TimeoutMonitor
Prepare to eliminate the TimerRecord struct.
2017-08-29 14:13:09 +02:00
Max Kellermann d4266d0063 event/Loop: remove unused method TimerRecord::IsDue() 2017-08-29 13:41:11 +02:00
Max Kellermann 5ac72211cd event/Loop: set thread to current thread by default
Allows eliminating lots of complexity and workarounds for bogus
assertion failures.
2017-08-18 18:18:55 +02:00
Max Kellermann 7f9a2f8adb event/Loop: schedule and cancel the WakeFD in Run()
This is only needed while Run() is alive, and moving it there avoids
problems with thread-checking assertions.
2017-08-18 18:08:06 +02:00
Max Kellermann 6d43e70a93 event/SignalMonitor: throw exception instead of raising fatal error 2017-08-11 09:36:22 +02:00
Max Kellermann 33b4114534 system/fd_util: remove unused library 2017-08-11 09:20:15 +02:00
Max Kellermann d705a92e43 net/IPv4Address: new class 2017-08-11 09:09:04 +02:00
Max Kellermann 1f47dc990d net/SocketDescriptor: add method SetKeepAlive() 2017-08-10 19:25:02 +02:00
Max Kellermann 9a5bcc6db0 net/ServerSocket: pass UniqueSocketDescriptor&& to OnAccept() 2017-08-10 19:20:14 +02:00
Max Kellermann 492b20a89d event/SocketMonitor: use class SocketDescriptor 2017-08-10 19:19:58 +02:00
Max Kellermann da90f484aa net/SocketUtil: socket_bind_listen() returns UniqueSocketDescriptor 2017-08-10 13:12:13 +02:00
Max Kellermann 979f1b6c39 Merge tag 'v0.20.9'
release v0.20.9
2017-06-04 12:57:05 +02:00
Max Kellermann a057b4f6d8 *: add lost of "noexcept" specifications 2017-06-04 12:46:48 +02:00
Max Kellermann 4faef28cc5 Merge tag 'v0.20.7'
release v0.20.7
2017-05-15 23:01:49 +02:00
Max Kellermann 71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann 781487c4dd thread/Thread: use BoundMethod 2017-02-10 22:46:09 +01:00
Max Kellermann 9324fbf921 event/Thread: remove the Mutex
We don't need to access Thread::handle early inside the EventThread,
so we don't need this trick anymore.
2017-02-10 22:29:31 +01:00
Max Kellermann 115af4f565 event/Loop: Break() is no-op if "quit" is already set 2017-02-10 22:24:48 +01:00
Max Kellermann 822724d1aa event/Thread: auto-stop in the destructor 2017-02-10 22:24:46 +01:00
Max Kellermann de80c270bd IOThread: move code to class EventThread 2017-02-10 21:40:39 +01:00
Max Kellermann 14986b153a event/Loop: use std::lock_guard 2017-02-09 21:26:55 +01:00
Max Kellermann 7372c931b3 event/Loop: make IsInsideOrNull() available in the NDEBUG build
Fixes build breakage by commit 4e5271fcdf7; and this method does make
sense in non-debug builds.
2017-02-09 21:21:49 +01:00
Max Kellermann eda06993f8 event/MultiSocketMonitor: add method Reset() 2017-02-09 21:12:23 +01:00
Max Kellermann 4b30ef1cf2 event/MultiSocketMonitor: use C++11 initializer 2017-02-09 21:12:23 +01:00
Max Kellermann e92e5e8eb8 event/MultiSocketMonitor: more API documentation
Now ClearSocketList() may only be called from PrepareSockets().
Calling it before destroying the object doesn't work properly, because
it doesn't unregister the TimeoutMonitor and the IdleMonitor.  Some of
its callers need to be fixed.
2017-02-09 21:12:23 +01:00
Max Kellermann 4e5271fcdf event/Call: allow usage during shutdown
Change EventLoop::IsInside() call to EventLoop::IsInsideOrNull().
This means that BlockingCall() may be used during shutdown, after the
main EventLoop::Run() has finished.  This is important because mixers
are currently registered in the main EventLoop.
2017-02-09 21:12:23 +01:00
Max Kellermann 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 2e182e84c3 thread/Mutex: remove ScopeLock, use std::lock_guard directly 2017-01-03 07:11:57 +01:00
Max Kellermann b042095ac2 event/Loop: use std::chrono 2016-12-28 01:15:08 +01:00
Max Kellermann 018c5ef731 event/Loop: use C++11 initializers 2016-12-27 23:13:26 +01:00
Max Kellermann e2b7c30811 event/BufferedSocket: pass std::exception_ptr to OnSocketError() 2016-11-02 10:38:05 +01:00
Max Kellermann aead221184 event/ServerSocket: migrate from class Error to C++ exceptions 2016-10-28 21:22:25 +02:00
Max Kellermann 63ab7767a3 event/Call: rethrow exceptions in calling thread 2016-09-09 18:14:21 +02:00