Commit Graph

209 Commits

Author SHA1 Message Date
Max Kellermann
b57e2f5521 event/DeferredMonitor: eliminate obsolete class
Move its code to DeferEvent instead.
2017-11-12 17:34:06 +01:00
Max Kellermann
bf3ced6a34 event/Call: migrate from DeferredMonitor to DeferEvent 2017-11-12 17:32:23 +01:00
Max Kellermann
42ad753e39 event/MaskMonitor: migrate from DeferredMonitor to DeferEvent 2017-11-10 21:10:46 +01:00
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 release v0.20.9
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkz5jkQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEubuD/kBXMcV4XawqGNNtSHdrY8CxSL8wJMCMJQl
 aMgRkKLPRml8Hj9FNNG9pjXBuT+qUgPX7t9gBEiT7c+sV3fHH40gUf1js5GIsEPm
 BAVfvww5EhmQWWVhPTLk1iZ4jp6E96mDmIG1znwo7etSZHXU8RJfR7woBi3SPJ9f
 OPcrimskNuWpAWeaEIKi/1Iwzy8d9VK9Ttb73gA3M5zSm7ioXzt3YClpwLRM8JU6
 QeUJchy6VwXnygswjUNmbhPc3GsD2FyUZ4OtJ0hodnqqajfldBxhcHUnQk4zZULr
 1nLSyOuA9bwLuFohH1T6HiY9z8PFzgqdIHvsjOJgZ4gQa69PVNjal2tUEUav9zFv
 aK4LvTVPnIk+hqRbtLpV7/rPKuClrC9BO4oYdBGBDNY4hqVpvRA9obP1s00aOi+K
 UhYqLqg7yeIEeTlUxFOhXJCKAEL69BuXT5ihJtDlB/dCUzv37sEch/4WDgs7uc+O
 9kJYlElvozw57mbczsee/PCSnSWrLCq/qG/bNEUUQOTueWNuifh3PL62UXGgfbEH
 01hJDyLr6ETSmWn7rjTfLJiHThX/EQQvOhs+35fbCyry65z4tFwrilGDmFVUWGPq
 /6QEpY1D6q4fkoma/iWOZoTkfKewatAPGMGWoJaGhCnfQFz4VTFtS2bDtuUctQ16
 jnXnPFxqBw==
 =0SSp
 -----END PGP SIGNATURE-----

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 release v0.20.7
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkaFL0QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEr4ID/9iAQC+7fFv06uLOm48Ufu+PgoD8uJkAwF5
 QuLQkc85g9urn+bu9N7Qs7Vypp7aLyGcJKY0jyA8wxkOj24pUC3GYk80daUt561V
 5s20FnoS/Uoman3CSJL94IfCUBxejizE6vgIIHTc5bb6U0qIsPub/8JTTE2Ih7uP
 nvFZ5uBQ+YTc7at+iIH9123eUMKkitkh8osNblovqQT9v42++Tm4ztAytRHBjwUA
 Itew5HhlvahbLKqFs/7vmICh/YX1FcOV7cV+erEWYfkH0KCI2bhSle4u2d0CBOvD
 VJlDnBCo9bM7WKcPYqJiFFFXA0CRk06wbkkkAtwF4zjp8xos7aQcq4FyQnYL8KXo
 5lijIhRwBURBd+nt8oA9kuEhBt/T75otcemJkzVaYappHTJCLjhxSGcPt8mw+nE9
 9WQzsp/MIVzg9l5g3D9S/43xM7uhvn98Tn1Qf2s8YRd2o8CZeOhW+X3RvbCvVPv2
 mOlx4sFAv8DOJ3KxMdqiJT+PmylPyJluQdqH+tMc8BdPg/kpSpYIPTuSjjRqK1yh
 ld5do0HtAAwiHtvXfk5YVFjJSpO0c8yVn6xci2Cl4k/5ZHj2UE1ln+N5vCea2BRF
 2J3HAjROwtcwY3lU1jFnEAogf24KWiFJqhhC0EqBGUdlrM8Dn37P5cEWWjROIMNK
 lPEdovokNw==
 =CdDy
 -----END PGP SIGNATURE-----

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