Commit Graph

7 Commits

Author SHA1 Message Date
Max Kellermann
6f2e1c2415 GlobalEvents: use g_idle_add() instead of WakeFD()
Use the GMainLoop specific function to wake up the main loop.  This is
simpler and comes with very little overhead.
2013-02-27 20:41:17 +01:00
Max Kellermann
fc0ad8674b GlobalEvents: wake up only if the flags were empty
Don't bother checking for the parameter mask.  This doesn't matter.
The only thing that matters is if a wake-up is already pending.
2013-02-27 20:40:46 +01:00
Max Kellermann
19c67ab724 Idle, GlobalEvents: use std::atomic::exchange()
Less overhead than fetch_and() for what we do.
2013-02-27 20:35:44 +01:00
Denis Krjuchkov
90ab65f8c7 WakeFD.cxx: use two sockets instead of pipe on Win32
Pipes aren't really pollable on Windows.
GLib emulates polling on pipes using separate reader/writer threads.
This adds significant overhead and keeps a strong dependency on GLib.

socketpair() function is absent on Windows as well.
We implement it here in a loose way.
2013-01-13 15:30:53 +06:00
Max Kellermann
5c3c506638 GlobalEvents: lock-less operation using std::atomic
Use a bit field instead of a mutex-protected bool array.
2013-01-10 00:57:18 +01:00
Max Kellermann
a93caf3cfe GlobalEvents: move code to class WakeFD 2013-01-09 23:47:38 +01:00
Max Kellermann
26ebfc04b0 EventPipe: rename to GlobalEvents 2013-01-09 23:31:43 +01:00