Sort wakeups and add send latency.
We don't want to rely on epoll to trigger wakeups in order. Timers will
likely wake up before watchers due to less kernel delays, etc. So,
maintain a sorted list of events and see which should be triggered first
and trigger it first. It also merges wakeups nicely.
This gives us the infrastructure to handle the same problem in
simulation. We can have perfect timers, and senders with latency. But,
if a timer wakes up while something is being sent, we will move up the
wakeup and handle it in order.
Change-Id: I8675ec5221dd2603b4aa5b1a3729907a599813b4
diff --git a/aos/events/shm_event_loop.h b/aos/events/shm_event_loop.h
index 89a2721..5063186 100644
--- a/aos/events/shm_event_loop.h
+++ b/aos/events/shm_event_loop.h
@@ -77,7 +77,7 @@
friend class internal::ShmSender;
friend class internal::ShmFetcher;
- void HandleWatcherSignal();
+ void HandleEvent();
// Tracks that we can't have multiple watchers or a sender and a watcher (or
// multiple senders) on a single queue (path).
@@ -94,6 +94,7 @@
internal::EPoll epoll_;
};
+
} // namespace aos
#endif // AOS_EVENTS_SHM_EVENT_LOOP_H_