Run all timers in the main thread with epoll
This ditches 1+ threads in all use cases.
Change-Id: I8772a539c20cd10d80a57f3f53c48a3d8124461a
diff --git a/aos/events/event-loop.h b/aos/events/event-loop.h
index 79651ef..1435723 100644
--- a/aos/events/event-loop.h
+++ b/aos/events/event-loop.h
@@ -29,8 +29,8 @@
private:
friend class EventLoop;
- Fetcher(std::unique_ptr<RawFetcher> fetcher) : fetcher_(std::move(fetcher)) {}
- std::unique_ptr<RawFetcher> fetcher_;
+ Fetcher(::std::unique_ptr<RawFetcher> fetcher) : fetcher_(::std::move(fetcher)) {}
+ ::std::unique_ptr<RawFetcher> fetcher_;
};
// Sends messages to a queue.
@@ -85,8 +85,8 @@
private:
friend class EventLoop;
- Sender(std::unique_ptr<RawSender> sender) : sender_(std::move(sender)) {}
- std::unique_ptr<RawSender> sender_;
+ Sender(::std::unique_ptr<RawSender> sender) : sender_(::std::move(sender)) {}
+ ::std::unique_ptr<RawSender> sender_;
};
// TODO(parker): Consider making EventLoop wrap a RawEventLoop rather than
@@ -105,14 +105,14 @@
// Makes a class that will always fetch the most recent value
// sent to path.
template <typename T>
- Fetcher<T> MakeFetcher(const std::string &path) {
+ Fetcher<T> MakeFetcher(const ::std::string &path) {
return Fetcher<T>(MakeRawFetcher(path, QueueTypeInfo::Get<T>()));
}
// Makes class that allows constructing and sending messages to
// address path.
template <typename T>
- Sender<T> MakeSender(const std::string &path) {
+ Sender<T> MakeSender(const ::std::string &path) {
return Sender<T>(MakeRawSender(path, QueueTypeInfo::Get<T>()));
}
@@ -123,11 +123,11 @@
// Note that T needs to match both send and recv side.
// TODO(parker): Need to support ::std::bind. For now, use lambdas.
template <typename Watch>
- void MakeWatcher(const std::string &path, Watch &&w);
+ void MakeWatcher(const ::std::string &path, Watch &&w);
// The passed in function will be called when the event loop starts.
// Use this to run code once the thread goes into "real-time-mode",
- virtual void OnRun(std::function<void()>) = 0;
+ virtual void OnRun(::std::function<void()>) = 0;
// TODO(austin): OnExit