event/DeferredMonitor: use EventLoop::AddIdle()

This commit is contained in:
Max Kellermann
2013-08-07 19:38:10 +02:00
parent fdc7d13ad1
commit 977004c350
5 changed files with 16 additions and 7 deletions

View File

@@ -26,15 +26,19 @@
#include <atomic>
class EventLoop;
/**
* Defer execution of an event into an #EventLoop.
*/
class DeferredMonitor {
EventLoop &loop;
std::atomic<guint> source_id;
public:
DeferredMonitor()
:source_id(0) {}
DeferredMonitor(EventLoop &_loop)
:loop(_loop), source_id(0) {}
~DeferredMonitor() {
Cancel();